[STATEMENT]
lemma ordertype_eq_Ord [simp]:
  assumes "Ord \<alpha>"
  shows "ordertype (elts \<alpha>) VWF = \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype (elts \<alpha>) VWF = \<alpha>
[PROOF STEP]
using assms ordermap_eq_self [OF assms]
[PROOF STATE]
proof (prove)
using this:
Ord \<alpha>
?x \<in> elts \<alpha> \<Longrightarrow> ordermap (elts \<alpha>) VWF ?x = ?x

goal (1 subgoal):
 1. ordertype (elts \<alpha>) VWF = \<alpha>
[PROOF STEP]
by (simp add: ordertype_def)


[STATEMENT]
lemma starfun_n_add_minus: "( *fn* f) z + -( *fn* g) z = ( *fn* (\<lambda>i x. f i x + -g i x)) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*fn* f) z + - (*fn* g) z = (*fn* (\<lambda>i x. f i x + - g i x)) z
[PROOF STEP]
by (cases z) (simp add: starfun_n star_n_minus star_n_add)


[STATEMENT]
lemma rename_constrains:
     "bij h ==> (rename h F \<in> (h`A) co (h`B)) = (F \<in> A co B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> (rename h F \<in> h ` A co h ` B) = (F \<in> A co B)
[PROOF STEP]
apply (unfold rename_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> (extend (\<lambda>(x, u). h x) F \<in> h ` A co h ` B) = (F \<in> A co B)
[PROOF STEP]
apply (subst extend_set_eq_image [symmetric])+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> (extend (\<lambda>(x, u). h x) F \<in> extend_set (\<lambda>(x, u). h x) A co extend_set (\<lambda>(x, u). h x) B) = (F \<in> A co B)
[PROOF STEP]
apply (erule good_map_bij [THEN Extend.intro, THEN Extend.extend_constrains])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma length_filter_mono[intro]:
  assumes "(\<And> x. P x \<Longrightarrow> Q x)"
  shows "length (filter P xs) \<le> length (filter Q xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter P xs) \<le> length (filter Q xs)
[PROOF STEP]
by (induction xs) (auto dest: assms)


[STATEMENT]
lemma continuous_map_pairedI [continuous_intros]:
   "\<lbrakk>continuous_map Z X f; continuous_map Z Y g\<rbrakk> \<Longrightarrow> continuous_map Z (prod_topology X Y) (\<lambda>x. (f x,g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map Z X f; continuous_map Z Y g\<rbrakk> \<Longrightarrow> continuous_map Z (prod_topology X Y) (\<lambda>x. (f x, g x))
[PROOF STEP]
by (simp add: continuous_map_pairwise o_def)


[STATEMENT]
lemma t1_space_closedin_singleton:
   "t1_space X \<longleftrightarrow> (\<forall>x \<in> topspace X. closedin X {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t1_space X = (\<forall>x\<in>topspace X. closedin X {x})
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. t1_space X \<Longrightarrow> \<forall>x\<in>topspace X. closedin X {x}
 2. \<forall>x\<in>topspace X. closedin X {x} \<Longrightarrow> t1_space X
[PROOF STEP]
apply (simp add: closedin_contains_derived_set t1_space_derived_set_of_singleton)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>topspace X. closedin X {x} \<Longrightarrow> t1_space X
[PROOF STEP]
using t1_space_alt
[PROOF STATE]
proof (prove)
using this:
t1_space ?X = (\<forall>x\<in>topspace ?X. \<forall>y\<in>topspace ?X. x \<noteq> y \<longrightarrow> (\<exists>U. closedin ?X U \<and> x \<in> U \<and> y \<notin> U))

goal (1 subgoal):
 1. \<forall>x\<in>topspace X. closedin X {x} \<Longrightarrow> t1_space X
[PROOF STEP]
by auto


[STATEMENT]
lemma subst_bexi:
"\<phi> \<in> fmla \<Longrightarrow> t \<in> atrm \<Longrightarrow> t1 \<in> atrm \<Longrightarrow> x \<in> var \<Longrightarrow> y \<in> var \<Longrightarrow> x \<noteq> y \<Longrightarrow> x \<notin> FvarsT t1 \<Longrightarrow>
 subst (bexi x t \<phi>) t1 y = bexi x (substT t t1 y) (subst \<phi> t1 y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<phi> \<in> fmla; t \<in> atrm; t1 \<in> atrm; x \<in> var; y \<in> var; x \<noteq> y; x \<notin> FvarsT t1\<rbrakk> \<Longrightarrow> subst (bexi x t \<phi>) t1 y = bexi x (substT t t1 y) (subst \<phi> t1 y)
[PROOF STEP]
unfolding bexi_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<phi> \<in> fmla; t \<in> atrm; t1 \<in> atrm; x \<in> var; y \<in> var; x \<noteq> y; x \<notin> FvarsT t1\<rbrakk> \<Longrightarrow> subst (exi x (cnj (LLq (Var x) t) \<phi>)) t1 y = exi x (cnj (LLq (Var x) (substT t t1 y)) (subst \<phi> t1 y))
[PROOF STEP]
by simp


[STATEMENT]
lemma ndepth_Push_Node_Inl:
  "ndepth (Push_Node (Inl a) n) = Suc (ndepth n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ndepth (Push_Node (Inl a) n) = Suc (ndepth n)
[PROOF STEP]
using Rep_Node[of n, unfolded Node_def]
[PROOF STATE]
proof (prove)
using this:
Rep_Node n \<in> {p. \<exists>f x k. p = (f, x) \<and> f k = Inr 0}

goal (1 subgoal):
 1. ndepth (Push_Node (Inl a) n) = Suc (ndepth n)
[PROOF STEP]
apply(simp add: ndepth_def Push_Node_def Abs_Node_inverse[OF Node_Push_I[OF Rep_Node]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. (\<exists>x. Rep_Node n = (f, x)) \<and> (\<exists>k. f k = Inr 0) \<Longrightarrow> (case apfst (Old_Datatype.Push (Inl a)) (Rep_Node n) of (f, x) \<Rightarrow> LEAST k. f k = Inr 0) = Suc (case Rep_Node n of (f, x) \<Rightarrow> LEAST k. f k = Inr 0)
[PROOF STEP]
apply(simp add: Push_def split_beta)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. (\<exists>x. Rep_Node n = (f, x)) \<and> (\<exists>k. f k = Inr 0) \<Longrightarrow> (LEAST k. (case k of 0 \<Rightarrow> Inl a | Suc x \<Rightarrow> fst (Rep_Node n) x) = Inr 0) = Suc (LEAST k. fst (Rep_Node n) k = Inr 0)
[PROOF STEP]
apply(rule Least_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>f. (\<exists>x. Rep_Node n = (f, x)) \<and> (\<exists>k. f k = Inr 0) \<Longrightarrow> (case Suc (LEAST k. fst (Rep_Node n) k = Inr 0) of 0 \<Rightarrow> Inl a | Suc x \<Rightarrow> fst (Rep_Node n) x) = Inr 0
 2. \<And>y. \<lbrakk>\<exists>f. (\<exists>x. Rep_Node n = (f, x)) \<and> (\<exists>k. f k = Inr 0); (case y of 0 \<Rightarrow> Inl a | Suc x \<Rightarrow> fst (Rep_Node n) x) = Inr 0\<rbrakk> \<Longrightarrow> Suc (LEAST k. fst (Rep_Node n) k = Inr 0) \<le> y
[PROOF STEP]
apply(auto elim: LeastI intro: ndepth_Push_Node_Inl_aux)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma basis_for_obtain_unique_scalars :
  "basis_for V vs \<Longrightarrow> v \<in> V \<Longrightarrow> \<exists>! as. length as = length vs \<and> v = as \<bullet>\<cdot> vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set vs \<subseteq> V \<and> V = RSpan vs \<and> R_lin_independent vs; v \<in> V\<rbrakk> \<Longrightarrow> \<exists>!as. length as = length vs \<and> v = as \<bullet>\<cdot> vs
[PROOF STEP]
using lin_independent_obtain_unique_scalars
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set ?ms \<subseteq> V; R_lin_independent ?ms; ?n \<in> RSpan ?ms\<rbrakk> \<Longrightarrow> \<exists>!rs. set rs \<subseteq> UNIV \<and> length rs = length ?ms \<and> ?n = rs \<bullet>\<cdot> ?ms

goal (1 subgoal):
 1. \<lbrakk>set vs \<subseteq> V \<and> V = RSpan vs \<and> R_lin_independent vs; v \<in> V\<rbrakk> \<Longrightarrow> \<exists>!as. length as = length vs \<and> v = as \<bullet>\<cdot> vs
[PROOF STEP]
by fast


[STATEMENT]
lemma find_remove_None_iff :
  "find_remove P xs = None \<longleftrightarrow> \<not> (\<exists>x . x \<in> set xs \<and> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (find_remove P xs = None) = (\<nexists>x. x \<in> set xs \<and> P x)
[PROOF STEP]
unfolding find_remove.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (find_remove' P xs [] = None) = (\<nexists>x. x \<in> set xs \<and> P x)
[PROOF STEP]
using find_remove'_set(1,2)
        find_remove'_set_rev
[PROOF STATE]
proof (prove)
using this:
find_remove' ?P ?xs ?prev = Some (?x, ?xs') \<Longrightarrow> ?P ?x
find_remove' ?P ?xs ?prev = Some (?x, ?xs') \<Longrightarrow> ?x \<in> set ?xs
\<lbrakk>?x \<in> set ?xs; ?P ?x\<rbrakk> \<Longrightarrow> find_remove' ?P ?xs ?prev \<noteq> None

goal (1 subgoal):
 1. (find_remove' P xs [] = None) = (\<nexists>x. x \<in> set xs \<and> P x)
[PROOF STEP]
by (metis old.prod.exhaust option.exhaust)


[STATEMENT]
lemma 05: \<open>\<turnstile> (p \<rightarrow> q \<rightarrow> r) \<rightarrow> (s \<rightarrow> q) \<rightarrow> p \<rightarrow> s \<rightarrow> r\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (p \<rightarrow> q \<rightarrow> r) \<rightarrow> (s \<rightarrow> q) \<rightarrow> p \<rightarrow> s \<rightarrow> r
[PROOF STEP]
using MP 04 04
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<turnstile> ?p \<rightarrow> ?q; \<turnstile> ?p\<rbrakk> \<Longrightarrow> \<turnstile> ?q
\<turnstile> (((?q \<rightarrow> ?r) \<rightarrow> ?p \<rightarrow> ?r) \<rightarrow> ?s) \<rightarrow> (?p \<rightarrow> ?q) \<rightarrow> ?s
\<turnstile> (((?q \<rightarrow> ?r) \<rightarrow> ?p \<rightarrow> ?r) \<rightarrow> ?s) \<rightarrow> (?p \<rightarrow> ?q) \<rightarrow> ?s

goal (1 subgoal):
 1. \<turnstile> (p \<rightarrow> q \<rightarrow> r) \<rightarrow> (s \<rightarrow> q) \<rightarrow> p \<rightarrow> s \<rightarrow> r
[PROOF STEP]
.


[STATEMENT]
theorem SubstFormP_Neg: "{SubstFormP v i x x'} \<turnstile> SubstFormP v i (Q_Neg x) (Q_Neg x')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {SubstFormP v i x x'} \<turnstile> SubstFormP v i (Q_Neg x) (Q_Neg x')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {SubstFormP v i x x'} \<turnstile> SubstFormP v i (Q_Neg x) (Q_Neg x')
[PROOF STEP]
obtain k1::name and s1::name and k::name and s::name
    where "atom s1 \<sharp> (v,i,x,x')"        "atom k1 \<sharp> (v,i,x,x',s1)"
          "atom s  \<sharp> (v,i,x,x',k1,s1)"  "atom k  \<sharp> (v,i,x,x',s,k1,s1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s1 k1 s k. \<lbrakk>atom s1 \<sharp> (v, i, x, x'); atom k1 \<sharp> (v, i, x, x', s1); atom s \<sharp> (v, i, x, x', k1, s1); atom k \<sharp> (v, i, x, x', s, k1, s1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis obtain_fresh)
[PROOF STATE]
proof (state)
this:
atom s1 \<sharp> (v, i, x, x')
atom k1 \<sharp> (v, i, x, x', s1)
atom s \<sharp> (v, i, x, x', k1, s1)
atom k \<sharp> (v, i, x, x', s, k1, s1)

goal (1 subgoal):
 1. {SubstFormP v i x x'} \<turnstile> SubstFormP v i (Q_Neg x) (Q_Neg x')
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
atom s1 \<sharp> (v, i, x, x')
atom k1 \<sharp> (v, i, x, x', s1)
atom s \<sharp> (v, i, x, x', k1, s1)
atom k \<sharp> (v, i, x, x', s, k1, s1)

goal (1 subgoal):
 1. {SubstFormP v i x x'} \<turnstile> SubstFormP v i (Q_Neg x) (Q_Neg x')
[PROOF STEP]
by (force simp: SubstFormP.simps [of s v i "Q_Neg x" _ k] SubstFormP.simps [of s1 v i x x' k1]
               intro: SeqSubstFormP_Neg [THEN cut3])
[PROOF STATE]
proof (state)
this:
{SubstFormP v i x x'} \<turnstile> SubstFormP v i (Q_Neg x) (Q_Neg x')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma end_0smult: "range T \<subseteq> V \<Longrightarrow> 0 \<cdot>\<cdot> T = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range T \<subseteq> V \<Longrightarrow> (0::'f) \<cdot>\<cdot> T = 0
[PROOF STEP]
using zero_smult
[PROOF STATE]
proof (prove)
using this:
?m \<in> V \<Longrightarrow> (0::'f) \<cdot> ?m = (0::'v)

goal (1 subgoal):
 1. range T \<subseteq> V \<Longrightarrow> (0::'f) \<cdot>\<cdot> T = 0
[PROOF STEP]
by fastforce


[STATEMENT]
lemma cross_time_continuous:
  assumes "transversal_segment a b"
  assumes "x \<in> {a<--<b}"
  assumes "e > 0"
  obtains d t where "d > 0" "continuous_on (ball x d) t"
    "\<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}"
    "\<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e"
    "continuous_on (ball x d) t"
    "t x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "x \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> X
[PROOF STEP]
using assms segment_open_subset_closed[of a b]
[PROOF STATE]
proof (prove)
using this:
transversal_segment a b
x \<in> {a<--<b}
0 < e
{a<--<b} \<subseteq> {a--b}

goal (1 subgoal):
 1. x \<in> X
[PROOF STEP]
by (auto simp: transversal_segment_def)
[PROOF STATE]
proof (state)
this:
x \<in> X

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "a \<noteq> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
transversal_segment a b
x \<in> {a<--<b}
0 < e

goal (1 subgoal):
 1. a \<noteq> b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define s where "s x = (x - a) \<bullet> rot (b - a)" for x
[PROOF STATE]
proof (state)
this:
s ?x = (?x - a) \<bullet> rev.rot (b - a)

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "s x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s x = 0
[PROOF STEP]
unfolding s_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - a) \<bullet> rev.rot (b - a) = 0
[PROOF STEP]
by (subst in_segment_inner_rot) (auto intro!: assms open_closed_segment)
[PROOF STATE]
proof (state)
this:
s x = 0

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have Ds: "(s has_derivative blinfun_inner_left (rot (b - a))) (at x)"
    (is "(_ has_derivative blinfun_apply (?Ds x)) _")
    for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s has_derivative blinfun_apply (blinfun_inner_left (rev.rot (b - a)))) (at x)
[PROOF STEP]
unfolding s_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (x - a) \<bullet> rev.rot (b - a)) has_derivative blinfun_apply (blinfun_inner_left (rev.rot (b - a)))) (at x)
[PROOF STEP]
by (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
(s has_derivative blinfun_apply (blinfun_inner_left (rev.rot (b - a)))) (at ?x2)

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have Dsc: "isCont ?Ds x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>c. blinfun_inner_left (rev.rot (b - a))) x
[PROOF STEP]
by (auto intro!: continuous_intros)
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>c. blinfun_inner_left (rev.rot (b - a))) x

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have nz: "?Ds x (f x) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blinfun_apply (blinfun_inner_left (rev.rot (b - a))) (f x) \<noteq> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
transversal_segment a b
x \<in> {a<--<b}
0 < e

goal (1 subgoal):
 1. blinfun_apply (blinfun_inner_left (rev.rot (b - a))) (f x) \<noteq> 0
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>transversal_segment a b; x \<in> {a<--<b}; 0 < e; f x \<bullet> rev.rot (b - a) = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
unfolding transversal_segment_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<noteq> b \<and> {a--b} \<subseteq> X \<and> (\<forall>z\<in>{a--b}. f z \<bullet> rev.rot (a - b) \<noteq> 0); x \<in> {a<--<b}; 0 < e; f x \<bullet> rev.rot (b - a) = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (smt inner_minus_left nrm_reverse open_closed_segment)
[PROOF STATE]
proof (state)
this:
blinfun_apply (blinfun_inner_left (rev.rot (b - a))) (f x) \<noteq> 0

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from flow_implicit_function_at[OF \<open>x \<in> X\<close>, of s, OF \<open>s x = 0\<close> Ds Dsc nz \<open>e > 0\<close>]
[PROOF STATE]
proof (chain)
picking this:
(\<And>u d. \<lbrakk>0 < d; u x = 0; \<And>y. y \<in> cball x d \<Longrightarrow> s (flow0 y (u y)) = 0; \<And>y. y \<in> cball x d \<Longrightarrow> \<bar>u y\<bar> < e; \<And>y. y \<in> cball x d \<Longrightarrow> u y \<in> existence_ivl0 y; continuous_on (cball x d) u; (u has_derivative blinfun_apply (- blinfun_inner_left (rev.rot (b - a)) /\<^sub>R blinfun_apply (blinfun_inner_left (rev.rot (b - a))) (f x))) (at x)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain t d1 where "0 < d1"
    and t0: "t x = 0"
    and d1: "(\<And>y. y \<in> cball x d1 \<Longrightarrow> s (flow0 y (t y)) = 0)"
    "(\<And>y. y \<in> cball x d1 \<Longrightarrow> \<bar>t y\<bar> < e)"
    "(\<And>y. y \<in> cball x d1 \<Longrightarrow> t y \<in> existence_ivl0 y)"
    and tc: "continuous_on (cball x d1) t"
    and t': "(t has_derivative
        (- blinfun_inner_left (rot (b - a)) /\<^sub>R (blinfun_inner_left (rot (b - a))) (f x)))
      (at x)"
[PROOF STATE]
proof (prove)
using this:
(\<And>u d. \<lbrakk>0 < d; u x = 0; \<And>y. y \<in> cball x d \<Longrightarrow> s (flow0 y (u y)) = 0; \<And>y. y \<in> cball x d \<Longrightarrow> \<bar>u y\<bar> < e; \<And>y. y \<in> cball x d \<Longrightarrow> u y \<in> existence_ivl0 y; continuous_on (cball x d) u; (u has_derivative blinfun_apply (- blinfun_inner_left (rev.rot (b - a)) /\<^sub>R blinfun_apply (blinfun_inner_left (rev.rot (b - a))) (f x))) (at x)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>d1 t. \<lbrakk>0 < d1; t x = 0; \<And>y. y \<in> cball x d1 \<Longrightarrow> s (flow0 y (t y)) = 0; \<And>y. y \<in> cball x d1 \<Longrightarrow> \<bar>t y\<bar> < e; \<And>y. y \<in> cball x d1 \<Longrightarrow> t y \<in> existence_ivl0 y; continuous_on (cball x d1) t; (t has_derivative blinfun_apply (- blinfun_inner_left (rev.rot (b - a)) /\<^sub>R blinfun_apply (blinfun_inner_left (rev.rot (b - a))) (f x))) (at x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
0 < d1
t x = 0
?y2 \<in> cball x d1 \<Longrightarrow> s (flow0 ?y2 (t ?y2)) = 0
?y2 \<in> cball x d1 \<Longrightarrow> \<bar>t ?y2\<bar> < e
?y2 \<in> cball x d1 \<Longrightarrow> t ?y2 \<in> existence_ivl0 ?y2
continuous_on (cball x d1) t
(t has_derivative blinfun_apply (- blinfun_inner_left (rev.rot (b - a)) /\<^sub>R blinfun_apply (blinfun_inner_left (rev.rot (b - a))) (f x))) (at x)

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from tc
[PROOF STATE]
proof (chain)
picking this:
continuous_on (cball x d1) t
[PROOF STEP]
have "t \<midarrow>x\<rightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
continuous_on (cball x d1) t

goal (1 subgoal):
 1. t \<midarrow>x\<rightarrow> 0
[PROOF STEP]
using \<open>0 < d1\<close>
[PROOF STATE]
proof (prove)
using this:
continuous_on (cball x d1) t
0 < d1

goal (1 subgoal):
 1. t \<midarrow>x\<rightarrow> 0
[PROOF STEP]
by (auto simp: continuous_on_def at_within_interior t0 dest!: bspec[where x=x])
[PROOF STATE]
proof (state)
this:
t \<midarrow>x\<rightarrow> 0

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<midarrow>x\<rightarrow> 0
[PROOF STEP]
have ftc: "((\<lambda>y. flow0 y (t y)) \<longlongrightarrow> x) (at x)"
[PROOF STATE]
proof (prove)
using this:
t \<midarrow>x\<rightarrow> 0

goal (1 subgoal):
 1. (\<lambda>y. flow0 y (t y)) \<midarrow>x\<rightarrow> x
[PROOF STEP]
by (auto intro!: tendsto_eq_intros simp: \<open>x \<in> X\<close>)
[PROOF STATE]
proof (state)
this:
(\<lambda>y. flow0 y (t y)) \<midarrow>x\<rightarrow> x

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define e2 where "e2 = min (dist a x) (dist b x)"
[PROOF STATE]
proof (state)
this:
e2 = min (dist a x) (dist b x)

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "e2 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
transversal_segment a b
x \<in> {a<--<b}
0 < e

goal (1 subgoal):
 1. 0 < e2
[PROOF STEP]
by (auto simp: e2_def open_segment_def)
[PROOF STATE]
proof (state)
this:
0 < e2

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from tendstoD[OF ftc this]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F xa in at x. dist (flow0 xa (t xa)) x < e2
[PROOF STEP]
have "\<forall>\<^sub>F y in at x. dist (flow0 y (t y)) x < e2"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F xa in at x. dist (flow0 xa (t xa)) x < e2

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x. dist (flow0 y (t y)) x < e2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at x. dist (flow0 y (t y)) x < e2

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at x. dist (flow0 y (t y)) x < e2

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?S = "{x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "open ?S" "x \<in> ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)} &&& x \<in> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
[PROOF STEP]
using \<open>x \<in> {a<--<b}\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> {a<--<b}

goal (1 subgoal):
 1. open {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)} &&& x \<in> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
[PROOF STEP]
by (auto simp add: open_segment_line_hyperplanes \<open>a \<noteq> b\<close>
        intro!: open_Collect_conj open_halfspace_component_gt open_halfspace_component_lt)
[PROOF STATE]
proof (state)
this:
open {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
x \<in> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from topological_tendstoD[OF ftc this]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at x. flow0 x (t x) \<in> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
[PROOF STEP]
have "\<forall>\<^sub>F y in at x. flow0 y (t y) \<in> ?S"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at x. flow0 x (t x) \<in> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x. flow0 y (t y) \<in> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at x. flow0 y (t y) \<in> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F y in at x. dist (flow0 y (t y)) x < e2
\<forall>\<^sub>F y in at x. flow0 y (t y) \<in> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
[PROOF STEP]
have "\<forall>\<^sub>F y in at x. flow0 y (t y) \<in> ball x e2 \<inter> ?S"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in at x. dist (flow0 y (t y)) x < e2
\<forall>\<^sub>F y in at x. flow0 y (t y) \<in> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x. flow0 y (t y) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
[PROOF STEP]
by eventually_elim (auto simp: dist_commute)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at x. flow0 y (t y) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F y in at x. flow0 y (t y) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
[PROOF STEP]
obtain d2 where "0 < d2" and "\<And>y. x \<noteq> y \<Longrightarrow> dist y x < d2 \<Longrightarrow> flow0 y (t y) \<in> ball x e2 \<inter> ?S"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in at x. flow0 y (t y) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}

goal (1 subgoal):
 1. (\<And>d2. \<lbrakk>0 < d2; \<And>y. \<lbrakk>x \<noteq> y; dist y x < d2\<rbrakk> \<Longrightarrow> flow0 y (t y) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: eventually_at)
[PROOF STATE]
proof (state)
this:
0 < d2
\<lbrakk>x \<noteq> ?y2; dist ?y2 x < d2\<rbrakk> \<Longrightarrow> flow0 ?y2 (t ?y2) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < d2
\<lbrakk>x \<noteq> ?y2; dist ?y2 x < d2\<rbrakk> \<Longrightarrow> flow0 ?y2 (t ?y2) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
[PROOF STEP]
have d2: "dist y x < d2 \<Longrightarrow> flow0 y (t y) \<in> ball x e2 \<inter> ?S" for y
[PROOF STATE]
proof (prove)
using this:
0 < d2
\<lbrakk>x \<noteq> ?y2; dist ?y2 x < d2\<rbrakk> \<Longrightarrow> flow0 ?y2 (t ?y2) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}

goal (1 subgoal):
 1. dist y x < d2 \<Longrightarrow> flow0 y (t y) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
[PROOF STEP]
using \<open>0 < e2\<close> \<open>x \<in> X\<close> t0 \<open>x \<in> ?S\<close>
[PROOF STATE]
proof (prove)
using this:
0 < d2
\<lbrakk>x \<noteq> ?y2; dist ?y2 x < d2\<rbrakk> \<Longrightarrow> flow0 ?y2 (t ?y2) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
0 < e2
x \<in> X
t x = 0
x \<in> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}

goal (1 subgoal):
 1. dist y x < d2 \<Longrightarrow> flow0 y (t y) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
[PROOF STEP]
by (cases "y = x") auto
[PROOF STATE]
proof (state)
this:
dist ?y2 x < d2 \<Longrightarrow> flow0 ?y2 (t ?y2) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define d where "d = min d1 d2"
[PROOF STATE]
proof (state)
this:
d = min d1 d2

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "d > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < d
[PROOF STEP]
using \<open>0 < d1\<close> \<open>0 < d2\<close>
[PROOF STATE]
proof (prove)
using this:
0 < d1
0 < d2

goal (1 subgoal):
 1. 0 < d
[PROOF STEP]
by (simp add: d_def)
[PROOF STATE]
proof (state)
this:
0 < d

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < d

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "continuous_on (ball x d) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (ball x d) t
[PROOF STEP]
by (auto intro!:continuous_on_subset[OF tc] simp add: d_def)
[PROOF STATE]
proof (state)
this:
continuous_on (ball x d) t

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on (ball x d) t

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "ball x e2 \<inter> ?S \<inter> {x. s x = 0} \<subseteq> {a<--<b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)} \<inter> {x. s x = 0} \<subseteq> {a<--<b}
[PROOF STEP]
by (auto simp add: in_open_segment_iff_rot \<open>a \<noteq> b\<close>) (auto simp: s_def e2_def in_segment)
[PROOF STATE]
proof (state)
this:
ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)} \<inter> {x. s x = 0} \<subseteq> {a<--<b}

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)} \<inter> {x. s x = 0} \<subseteq> {a<--<b}
[PROOF STEP]
have "\<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}"
[PROOF STATE]
proof (prove)
using this:
ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)} \<inter> {x. s x = 0} \<subseteq> {a<--<b}

goal (1 subgoal):
 1. \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}
[PROOF STEP]
apply (rule set_mp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)} \<inter> {x. s x = 0}
[PROOF STEP]
using d1 d2 \<open>0 < d2\<close>
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> cball x d1 \<Longrightarrow> s (flow0 ?y2 (t ?y2)) = 0
?y2 \<in> cball x d1 \<Longrightarrow> \<bar>t ?y2\<bar> < e
?y2 \<in> cball x d1 \<Longrightarrow> t ?y2 \<in> existence_ivl0 ?y2
dist ?y2 x < d2 \<Longrightarrow> flow0 ?y2 (t ?y2) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)}
0 < d2

goal (1 subgoal):
 1. \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> ball x e2 \<inter> {x. a \<bullet> (b - a) < x \<bullet> (b - a) \<and> x \<bullet> (b - a) < b \<bullet> (b - a)} \<inter> {x. s x = 0}
[PROOF STEP]
by (auto simp: d_def e2_def dist_commute)
[PROOF STATE]
proof (state)
this:
?y2 \<in> ball x d \<Longrightarrow> flow0 ?y2 (t ?y2) \<in> {a<--<b}

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?y2 \<in> ball x d \<Longrightarrow> flow0 ?y2 (t ?y2) \<in> {a<--<b}

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e
[PROOF STEP]
using d1
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> cball x d1 \<Longrightarrow> s (flow0 ?y2 (t ?y2)) = 0
?y2 \<in> cball x d1 \<Longrightarrow> \<bar>t ?y2\<bar> < e
?y2 \<in> cball x d1 \<Longrightarrow> t ?y2 \<in> existence_ivl0 ?y2

goal (1 subgoal):
 1. \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e
[PROOF STEP]
by (auto simp: d_def)
[PROOF STATE]
proof (state)
this:
?y2 \<in> ball x d \<Longrightarrow> \<bar>t ?y2\<bar> < e

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?y2 \<in> ball x d \<Longrightarrow> \<bar>t ?y2\<bar> < e

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "continuous_on (ball x d) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (ball x d) t
[PROOF STEP]
using tc
[PROOF STATE]
proof (prove)
using this:
continuous_on (cball x d1) t

goal (1 subgoal):
 1. continuous_on (ball x d) t
[PROOF STEP]
by (rule continuous_on_subset) (auto simp: d_def)
[PROOF STATE]
proof (state)
this:
continuous_on (ball x d) t

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on (ball x d) t

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "t x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t x = 0
[PROOF STEP]
by (simp add: t0)
[PROOF STATE]
proof (state)
this:
t x = 0

goal (1 subgoal):
 1. (\<And>d t. \<lbrakk>0 < d; continuous_on (ball x d) t; \<And>y. y \<in> ball x d \<Longrightarrow> flow0 y (t y) \<in> {a<--<b}; \<And>y. y \<in> ball x d \<Longrightarrow> \<bar>t y\<bar> < e; continuous_on (ball x d) t; t x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < d
continuous_on (ball x d) t
?y2 \<in> ball x d \<Longrightarrow> flow0 ?y2 (t ?y2) \<in> {a<--<b}
?y2 \<in> ball x d \<Longrightarrow> \<bar>t ?y2\<bar> < e
continuous_on (ball x d) t
t x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < d
continuous_on (ball x d) t
?y2 \<in> ball x d \<Longrightarrow> flow0 ?y2 (t ?y2) \<in> {a<--<b}
?y2 \<in> ball x d \<Longrightarrow> \<bar>t ?y2\<bar> < e
continuous_on (ball x d) t
t x = 0

goal (1 subgoal):
 1. thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma deg_leqI:
  assumes "p \<in> carrier P"
  assumes "\<And>n. n > k \<Longrightarrow> p n = \<zero>"
  shows "degree p \<le> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R p \<le> k
[PROOF STEP]
by (metis assms(1) assms(2) deg_zero deg_ltrm le0 le_less_linear monom_zero)


[STATEMENT]
lemma countable_relpow:
  fixes X :: "'a rel"
  assumes Image_X: "\<And>Y. countable Y \<Longrightarrow> countable (X `` Y)"
  assumes Y: "countable Y"
  shows "countable ((X ^^ i) `` Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable ((X ^^ i) `` Y)
[PROOF STEP]
using Y
[PROOF STATE]
proof (prove)
using this:
countable Y

goal (1 subgoal):
 1. countable ((X ^^ i) `` Y)
[PROOF STEP]
by (induct i arbitrary: Y) (auto simp: relcomp_Image Image_X)


[STATEMENT]
lemma sum_list_ereal [simp]: "sum_list (map (\<lambda>x. ereal (f x)) xs) = ereal (sum_list (map f xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>xs. ereal (f x)) = ereal (sum_list (map f xs))
[PROOF STEP]
by (induction xs) simp_all


[STATEMENT]
lemma in_mk_uedge_img_iff: "{a,b} \<in> mk_edge ` A \<longleftrightarrow> (a,b) \<in> A \<or> (b,a) \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({a, b} \<in> mk_edge ` A) = ((a, b) \<in> A \<or> (b, a) \<in> A)
[PROOF STEP]
by (auto simp: doubleton_eq_iff intro: rev_image_eqI)


[STATEMENT]
lemma unat_ucast_up_simp:
  fixes x :: "'a::len word"
  assumes "LENGTH('a) \<le> LENGTH('b)"
  shows "unat (ucast x :: 'b::len word) = unat x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (ucast x) = unat x
[PROOF STEP]
apply (rule bit_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. possible_bit TYPE(nat) n \<Longrightarrow> bit (unat (ucast x)) n = bit (unat x) n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
LENGTH('a) \<le> LENGTH('b)

goal (1 subgoal):
 1. \<And>n. possible_bit TYPE(nat) n \<Longrightarrow> bit (unat (ucast x)) n = bit (unat x) n
[PROOF STEP]
apply (auto simp add: bit_simps dest: bit_imp_le_length)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma imgTr10:"\<lbrakk>Group F; Group G; f \<in> gHom F G; F \<guillemotright> H\<rbrakk> \<Longrightarrow> \<one>\<^bsub>G\<^esub> \<in> f ` H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; F \<guillemotright> H \<rbrakk> \<Longrightarrow> \<one>\<^bsub>G\<^esub> \<in> f ` H
[PROOF STEP]
apply (frule Group.sg_unit_closed[of "F" "H"], assumption+,
       subst ghom_unit_unit[THEN sym, of "F" "G" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; F \<guillemotright> H ; \<one>\<^bsub>F\<^esub> \<in> H\<rbrakk> \<Longrightarrow> f \<one>\<^bsub>F\<^esub> \<in> f ` H
[PROOF STEP]
apply (simp add:image_def, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma connex_dual_semicomplete: "semicomplete {C. connex C r} (\<supseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semicomplete {C. connex C r} (\<lambda>x y. y \<subseteq> x)
[PROOF STEP]
proof (intro completeI, elim CollectE)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>X \<subseteq> {C. connex C r}; X \<noteq> {}\<rbrakk> \<Longrightarrow> Ex (greatest {b \<in> {C. connex C r}. bound X (\<lambda>x y. y \<subseteq> x) b})
[PROOF STEP]
fix X
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>X \<subseteq> {C. connex C r}; X \<noteq> {}\<rbrakk> \<Longrightarrow> Ex (greatest {b \<in> {C. connex C r}. bound X (\<lambda>x y. y \<subseteq> x) b})
[PROOF STEP]
assume "X \<subseteq> {C. connex C r}" and "X \<noteq> {}"
[PROOF STATE]
proof (state)
this:
X \<subseteq> {C. connex C r}
X \<noteq> {}

goal (1 subgoal):
 1. \<And>X. \<lbrakk>X \<subseteq> {C. connex C r}; X \<noteq> {}\<rbrakk> \<Longrightarrow> Ex (greatest {b \<in> {C. connex C r}. bound X (\<lambda>x y. y \<subseteq> x) b})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
X \<subseteq> {C. connex C r}
X \<noteq> {}
[PROOF STEP]
have "connex (\<Inter>X) r"
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> {C. connex C r}
X \<noteq> {}

goal (1 subgoal):
 1. connex (\<Inter> X) r
[PROOF STEP]
by (auto simp: connex_def)
[PROOF STATE]
proof (state)
this:
connex (\<Inter> X) r

goal (1 subgoal):
 1. \<And>X. \<lbrakk>X \<subseteq> {C. connex C r}; X \<noteq> {}\<rbrakk> \<Longrightarrow> Ex (greatest {b \<in> {C. connex C r}. bound X (\<lambda>x y. y \<subseteq> x) b})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
connex (\<Inter> X) r
[PROOF STEP]
have "extreme_bound {C. connex C r} (\<supseteq>) X (\<Inter> X)"
[PROOF STATE]
proof (prove)
using this:
connex (\<Inter> X) r

goal (1 subgoal):
 1. greatest {b \<in> {C. connex C r}. bound X (\<lambda>x y. y \<subseteq> x) b} (\<Inter> X)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
greatest {b \<in> {C. connex C r}. bound X (\<lambda>x y. y \<subseteq> x) b} (\<Inter> X)

goal (1 subgoal):
 1. \<And>X. \<lbrakk>X \<subseteq> {C. connex C r}; X \<noteq> {}\<rbrakk> \<Longrightarrow> Ex (greatest {b \<in> {C. connex C r}. bound X (\<lambda>x y. y \<subseteq> x) b})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
greatest {b \<in> {C. connex C r}. bound X (\<lambda>x y. y \<subseteq> x) b} (\<Inter> X)
[PROOF STEP]
show "\<exists>S. extreme_bound {C. connex C r} (\<supseteq>) X S"
[PROOF STATE]
proof (prove)
using this:
greatest {b \<in> {C. connex C r}. bound X (\<lambda>x y. y \<subseteq> x) b} (\<Inter> X)

goal (1 subgoal):
 1. Ex (greatest {b \<in> {C. connex C r}. bound X (\<lambda>x y. y \<subseteq> x) b})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Ex (greatest {b \<in> {C. connex C r}. bound X (\<lambda>x y. y \<subseteq> x) b})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma B_finite: "finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite B
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
finite A
B \<subseteq> A
B \<noteq> {}

goal (1 subgoal):
 1. finite B
[PROOF STEP]
by(blast intro: finite_subset)


[STATEMENT]
lemma floor_of_int_eq[simp]: "x \<in> \<int> \<Longrightarrow> of_int \<lfloor>x\<rfloor> = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> \<int> \<Longrightarrow> of_int \<lfloor>x\<rfloor> = x
[PROOF STEP]
by (metis Ints_cases of_int_floor_cancel)


[STATEMENT]
theorem knights_path_exists:
  assumes "min n m \<ge> 5"
  shows "\<exists>ps. knights_path (board n m) ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
5 \<le> min n m

goal (1 subgoal):
 1. \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 5 \<le> min n m \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
have "odd n \<or> odd m \<or> even (n*m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd n \<or> odd m \<or> even (n * m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
odd n \<or> odd m \<or> even (n * m)

goal (1 subgoal):
 1. 5 \<le> min n m \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
odd n \<or> odd m \<or> even (n * m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
odd n \<or> odd m \<or> even (n * m)

goal (1 subgoal):
 1. \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
proof (elim disjE)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. odd n \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
 2. odd m \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
 3. even (n * m) \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
assume "odd n"
[PROOF STATE]
proof (state)
this:
odd n

goal (3 subgoals):
 1. odd n \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
 2. odd m \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
 3. even (n * m) \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
odd n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
odd n

goal (1 subgoal):
 1. \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
using assms knights_path_odd_n_exists
[PROOF STATE]
proof (prove)
using this:
odd n
5 \<le> min n m
\<lbrakk>odd ?n; 5 \<le> min ?n ?m\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board ?n ?m) ps \<and> hd ps = (int ?n, 1) \<and> last ps = (int ?n - 1, int ?m - 1)

goal (1 subgoal):
 1. \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>ps. knights_path (board n m) ps

goal (2 subgoals):
 1. odd m \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
 2. even (n * m) \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. odd m \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
 2. even (n * m) \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
assume "odd m"
[PROOF STATE]
proof (state)
this:
odd m

goal (2 subgoals):
 1. odd m \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
 2. even (n * m) \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
odd m
[PROOF STEP]
obtain ps where "knights_path (board m n) ps"
[PROOF STATE]
proof (prove)
using this:
odd m

goal (1 subgoal):
 1. (\<And>ps. knights_path (board m n) ps \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms knights_path_odd_n_exists
[PROOF STATE]
proof (prove)
using this:
odd m
5 \<le> min n m
\<lbrakk>odd ?n; 5 \<le> min ?n ?m\<rbrakk> \<Longrightarrow> \<exists>ps. knights_path (board ?n ?m) ps \<and> hd ps = (int ?n, 1) \<and> last ps = (int ?n - 1, int ?m - 1)

goal (1 subgoal):
 1. (\<And>ps. knights_path (board m n) ps \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
knights_path (board m n) ps

goal (2 subgoals):
 1. odd m \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
 2. even (n * m) \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
knights_path (board m n) ps
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
knights_path (board m n) ps

goal (1 subgoal):
 1. \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
using transpose_knights_path
[PROOF STATE]
proof (prove)
using this:
knights_path (board m n) ps
knights_path (board ?n ?m) ?ps \<Longrightarrow> knights_path (board ?m ?n) (KnightsTour.transpose ?ps)

goal (1 subgoal):
 1. \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>ps. knights_path (board n m) ps

goal (1 subgoal):
 1. even (n * m) \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. even (n * m) \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
assume "even (n*m)"
[PROOF STATE]
proof (state)
this:
even (n * m)

goal (1 subgoal):
 1. even (n * m) \<Longrightarrow> \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even (n * m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
even (n * m)

goal (1 subgoal):
 1. \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
using assms knights_circuit_exists
[PROOF STATE]
proof (prove)
using this:
even (n * m)
5 \<le> min n m
\<lbrakk>5 \<le> min ?n ?m; even (?n * ?m)\<rbrakk> \<Longrightarrow> \<exists>ps. knights_circuit (board ?n ?m) ps

goal (1 subgoal):
 1. \<exists>ps. knights_path (board n m) ps
[PROOF STEP]
by (auto simp: knights_circuit_def)
[PROOF STATE]
proof (state)
this:
\<exists>ps. knights_path (board n m) ps

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>ps. knights_path (board n m) ps

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LeadsTo_Un:
     "[| F \<in> A LeadsTo C; F \<in> B LeadsTo C |] ==> F \<in> (A \<union> B) LeadsTo C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> A \<longmapsto>w C; F \<in> B \<longmapsto>w C\<rbrakk> \<Longrightarrow> F \<in> A \<union> B \<longmapsto>w C
[PROOF STEP]
using LeadsTo_UN [of "{A, B}" F id C]
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i \<in> {A, B} \<Longrightarrow> F \<in> id i \<longmapsto>w C) \<Longrightarrow> F \<in> \<Union> (id ` {A, B}) \<longmapsto>w C

goal (1 subgoal):
 1. \<lbrakk>F \<in> A \<longmapsto>w C; F \<in> B \<longmapsto>w C\<rbrakk> \<Longrightarrow> F \<in> A \<union> B \<longmapsto>w C
[PROOF STEP]
by auto


[STATEMENT]
lemma lm024:
  assumes "f \<circ> g = id"
  shows "inj_on g UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<circ> g = id

goal (1 subgoal):
 1. inj g
[PROOF STEP]
by (metis inj_on_id inj_on_imageI2)


[STATEMENT]
lemma subcringE:
  assumes "subcring H R"
  shows "H \<subseteq> carrier R"
    and "\<zero>\<^bsub>R\<^esub> \<in> H"
    and "\<one>\<^bsub>R\<^esub> \<in> H"
    and "H \<noteq> {}"
    and "\<And>h. h \<in> H \<Longrightarrow> \<ominus>\<^bsub>R\<^esub> h \<in> H"
    and "\<And>h1 h2. \<lbrakk> h1 \<in> H; h2 \<in> H \<rbrakk> \<Longrightarrow> h1 \<otimes>\<^bsub>R\<^esub> h2 \<in> H"
    and "\<And>h1 h2. \<lbrakk> h1 \<in> H; h2 \<in> H \<rbrakk> \<Longrightarrow> h1 \<oplus>\<^bsub>R\<^esub> h2 \<in> H"
    and "\<And>h1 h2. \<lbrakk> h1 \<in> H; h2 \<in> H \<rbrakk> \<Longrightarrow> h1 \<otimes>\<^bsub>R\<^esub> h2 = h2 \<otimes>\<^bsub>R\<^esub> h1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((H \<subseteq> carrier R &&& \<zero>\<^bsub>R\<^esub> \<in> H) &&& \<one>\<^bsub>R\<^esub> \<in> H &&& H \<noteq> {}) &&& ((\<And>h. h \<in> H \<Longrightarrow> \<ominus>\<^bsub>R\<^esub> h \<in> H) &&& (\<And>h1 h2. \<lbrakk>h1 \<in> H; h2 \<in> H\<rbrakk> \<Longrightarrow> h1 \<otimes>\<^bsub>R\<^esub> h2 \<in> H)) &&& (\<And>h1 h2. \<lbrakk>h1 \<in> H; h2 \<in> H\<rbrakk> \<Longrightarrow> h1 \<oplus>\<^bsub>R\<^esub> h2 \<in> H) &&& (\<And>h1 h2. \<lbrakk>h1 \<in> H; h2 \<in> H\<rbrakk> \<Longrightarrow> h1 \<otimes>\<^bsub>R\<^esub> h2 = h2 \<otimes>\<^bsub>R\<^esub> h1)
[PROOF STEP]
using subringE[OF subcring.axioms(1)[OF assms]] subcring.sub_m_comm[OF assms]
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> carrier R
\<zero>\<^bsub>R\<^esub> \<in> H
\<one>\<^bsub>R\<^esub> \<in> H
H \<noteq> {}
?h \<in> H \<Longrightarrow> \<ominus>\<^bsub>R\<^esub> ?h \<in> H
\<lbrakk>?h1.0 \<in> H; ?h2.0 \<in> H\<rbrakk> \<Longrightarrow> ?h1.0 \<otimes>\<^bsub>R\<^esub> ?h2.0 \<in> H
\<lbrakk>?h1.0 \<in> H; ?h2.0 \<in> H\<rbrakk> \<Longrightarrow> ?h1.0 \<oplus>\<^bsub>R\<^esub> ?h2.0 \<in> H
\<lbrakk>?h1.0 \<in> H; ?h2.0 \<in> H\<rbrakk> \<Longrightarrow> ?h1.0 \<otimes>\<^bsub>R\<^esub> ?h2.0 = ?h2.0 \<otimes>\<^bsub>R\<^esub> ?h1.0

goal (1 subgoal):
 1. ((H \<subseteq> carrier R &&& \<zero>\<^bsub>R\<^esub> \<in> H) &&& \<one>\<^bsub>R\<^esub> \<in> H &&& H \<noteq> {}) &&& ((\<And>h. h \<in> H \<Longrightarrow> \<ominus>\<^bsub>R\<^esub> h \<in> H) &&& (\<And>h1 h2. \<lbrakk>h1 \<in> H; h2 \<in> H\<rbrakk> \<Longrightarrow> h1 \<otimes>\<^bsub>R\<^esub> h2 \<in> H)) &&& (\<And>h1 h2. \<lbrakk>h1 \<in> H; h2 \<in> H\<rbrakk> \<Longrightarrow> h1 \<oplus>\<^bsub>R\<^esub> h2 \<in> H) &&& (\<And>h1 h2. \<lbrakk>h1 \<in> H; h2 \<in> H\<rbrakk> \<Longrightarrow> h1 \<otimes>\<^bsub>R\<^esub> h2 = h2 \<otimes>\<^bsub>R\<^esub> h1)
[PROOF STEP]
by simp+


[STATEMENT]
lemma pp_total_linorder_matrix_1:
  fixes f :: "('a::finite,'b::non_trivial_linorder_stone_relation_algebra_expansion) square"
  assumes "\<ominus>(f \<odot> mtop) = mbot"
    shows "\<exists>j . f (i,j) \<noteq> bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j. f (i, j) \<noteq> bot
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>j. f (i, j) \<noteq> bot
[PROOF STEP]
have "\<not>(\<exists>j . f (i,j) \<noteq> bot) \<Longrightarrow> \<ominus>(f \<odot> mtop) \<noteq> mbot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>j. f (i, j) \<noteq> bot \<Longrightarrow> \<ominus> (f \<odot> mtop) \<noteq> mbot
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>j. f (i, j) \<noteq> bot \<Longrightarrow> \<ominus> (f \<odot> mtop) \<noteq> mbot
[PROOF STEP]
assume "\<not>(\<exists>j . f (i,j) \<noteq> bot)"
[PROOF STATE]
proof (state)
this:
\<nexists>j. f (i, j) \<noteq> bot

goal (1 subgoal):
 1. \<nexists>j. f (i, j) \<noteq> bot \<Longrightarrow> \<ominus> (f \<odot> mtop) \<noteq> mbot
[PROOF STEP]
hence "top = -(f \<odot> mtop) (i,i)"
[PROOF STATE]
proof (prove)
using this:
\<nexists>j. f (i, j) \<noteq> bot

goal (1 subgoal):
 1. top = - (f \<odot> mtop) (i, i)
[PROOF STEP]
by (simp add: comp_top_linorder_matrix linorder_finite_sup_selective)
[PROOF STATE]
proof (state)
this:
top = - (f \<odot> mtop) (i, i)

goal (1 subgoal):
 1. \<nexists>j. f (i, j) \<noteq> bot \<Longrightarrow> \<ominus> (f \<odot> mtop) \<noteq> mbot
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
top = - (f \<odot> mtop) (i, i)

goal (1 subgoal):
 1. \<nexists>j. f (i, j) \<noteq> bot \<Longrightarrow> \<ominus> (f \<odot> mtop) \<noteq> mbot
[PROOF STEP]
have "... = (\<ominus>(f \<odot> mtop)) (i,i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (f \<odot> mtop) (i, i) = (\<ominus> (f \<odot> mtop)) (i, i)
[PROOF STEP]
by (simp add: uminus_matrix_def)
[PROOF STATE]
proof (state)
this:
- (f \<odot> mtop) (i, i) = (\<ominus> (f \<odot> mtop)) (i, i)

goal (1 subgoal):
 1. \<nexists>j. f (i, j) \<noteq> bot \<Longrightarrow> \<ominus> (f \<odot> mtop) \<noteq> mbot
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
top = (\<ominus> (f \<odot> mtop)) (i, i)
[PROOF STEP]
show "\<ominus>(f \<odot> mtop) \<noteq> mbot"
[PROOF STATE]
proof (prove)
using this:
top = (\<ominus> (f \<odot> mtop)) (i, i)

goal (1 subgoal):
 1. \<ominus> (f \<odot> mtop) \<noteq> mbot
[PROOF STEP]
by (metis bot_matrix_def bot_not_top)
[PROOF STATE]
proof (state)
this:
\<ominus> (f \<odot> mtop) \<noteq> mbot

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<nexists>j. f (i, j) \<noteq> bot \<Longrightarrow> \<ominus> (f \<odot> mtop) \<noteq> mbot

goal (1 subgoal):
 1. \<exists>j. f (i, j) \<noteq> bot
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<nexists>j. f (i, j) \<noteq> bot \<Longrightarrow> \<ominus> (f \<odot> mtop) \<noteq> mbot

goal (1 subgoal):
 1. \<exists>j. f (i, j) \<noteq> bot
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<nexists>j. f (i, j) \<noteq> bot \<Longrightarrow> \<ominus> (f \<odot> mtop) \<noteq> mbot
matrix_p_algebra.dense (f \<odot> mtop)

goal (1 subgoal):
 1. \<exists>j. f (i, j) \<noteq> bot
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>j. f (i, j) \<noteq> bot

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LIM_equal: "\<forall>x. x \<noteq> a \<longrightarrow> f x = g x \<Longrightarrow> (f \<midarrow>a\<rightarrow> l) \<longleftrightarrow> (g \<midarrow>a\<rightarrow> l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x \<noteq> a \<longrightarrow> f x = g x \<Longrightarrow> f \<midarrow>a\<rightarrow> l = g \<midarrow>a\<rightarrow> l
[PROOF STEP]
by (simp add: tendsto_def eventually_at_topological)


[STATEMENT]
lemma inext_less_mono_fin: "
  \<lbrakk> a < b; a \<in> I; b \<in> I; finite I; b \<noteq> Max I \<rbrakk> \<Longrightarrow> inext a I < inext b I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; a \<in> I; b \<in> I; finite I; b \<noteq> Max I\<rbrakk> \<Longrightarrow> inext a I < inext b I
[PROOF STEP]
by (blast intro: inext_less_mono Max_in)


[STATEMENT]
lemma all_disjx_conv[simp]:
    "(\<forall>x. x \<or> P x) \<longleftrightarrow> P False"
    "(\<forall>x. x \<or> P (\<not>x)) \<longleftrightarrow> P True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<or> P x) = P False &&& (\<forall>x. x \<or> P (\<not> x)) = P True
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<forall>x. x \<or> P x \<Longrightarrow> P False
 2. \<And>x. \<lbrakk>P False; \<not> P x\<rbrakk> \<Longrightarrow> x
 3. \<forall>x. x \<or> P (\<not> x) \<Longrightarrow> P True
 4. \<And>x. \<lbrakk>P True; \<not> P (\<not> x)\<rbrakk> \<Longrightarrow> x
[PROOF STEP]
apply (drule spec[where x=False], simp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>P False; \<not> P x\<rbrakk> \<Longrightarrow> x
 2. \<forall>x. x \<or> P (\<not> x) \<Longrightarrow> P True
 3. \<And>x. \<lbrakk>P True; \<not> P (\<not> x)\<rbrakk> \<Longrightarrow> x
[PROOF STEP]
apply (case_tac x, auto) []
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x. x \<or> P (\<not> x) \<Longrightarrow> P True
 2. \<And>x. \<lbrakk>P True; \<not> P (\<not> x)\<rbrakk> \<Longrightarrow> x
[PROOF STEP]
apply (drule spec[where x=False], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>P True; \<not> P (\<not> x)\<rbrakk> \<Longrightarrow> x
[PROOF STEP]
apply (case_tac x, auto) []
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cross_ratio_0inf:
  assumes "y \<noteq> 0"
  shows "cross_ratio (of_complex x) 0\<^sub>h (of_complex y) \<infinity>\<^sub>h = (of_complex (x / y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cross_ratio (of_complex x) 0\<^sub>h (of_complex y) \<infinity>\<^sub>h = of_complex (x / y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
y \<noteq> 0

goal (1 subgoal):
 1. cross_ratio (of_complex x) 0\<^sub>h (of_complex y) \<infinity>\<^sub>h = of_complex (x / y)
[PROOF STEP]
by (transfer, transfer) (simp, rule_tac x="-1/y" in exI, simp)


[STATEMENT]
lemma Fake_parts_insert:
     "X \<in> synth (analz H) \<Longrightarrow>
      parts (insert X H) \<subseteq> synth (analz H) \<union> parts H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<in> synth (analz H) \<Longrightarrow> parts (insert X H) \<subseteq> synth (analz H) \<union> parts H
[PROOF STEP]
by (metis Un_commute analz_increasing insert_subset parts_analz parts_mono
          parts_synth synth_mono synth_subset_iff)


[STATEMENT]
lemma SETId: assumes "x |\<in>| X" shows "(Id SET X) |@| x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
have "X \<in> Obj SET"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<in> obj\<^bsub>SET\<^esub>
[PROOF STEP]
by (simp add: SET_def SET'_def MakeCat_def)
[PROOF STATE]
proof (state)
this:
X \<in> obj\<^bsub>SET\<^esub>

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
hence "isZFfun(Id SET X)"
[PROOF STATE]
proof (prove)
using this:
X \<in> obj\<^bsub>SET\<^esub>

goal (1 subgoal):
 1. isZFfun (id\<^bsub>SET\<^esub> X)
[PROOF STEP]
by (simp add: SETCategory Category.CatIdInMor SETmor)
[PROOF STATE]
proof (state)
this:
isZFfun (id\<^bsub>SET\<^esub> X)

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
isZFfun (id\<^bsub>SET\<^esub> X)

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
have "(Id SET X) = ZFfun X X (\<lambda>x. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x |\<in>| X

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)
[PROOF STEP]
by (simp add: SET_def SET'_def MakeCat_def)
[PROOF STATE]
proof (state)
this:
id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
isZFfun (id\<^bsub>SET\<^esub> X)
id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isZFfun (id\<^bsub>SET\<^esub> X)
id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isZFfun (id\<^bsub>SET\<^esub> X)
id\<^bsub>SET\<^esub> X = ZFfun X X (\<lambda>x. x)
x |\<in>| X

goal (1 subgoal):
 1. id\<^bsub>SET\<^esub> X |@| x = x
[PROOF STEP]
by (simp add: ZFfunApp)
[PROOF STATE]
proof (state)
this:
id\<^bsub>SET\<^esub> X |@| x = x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vimage_algebra_cong:
  assumes "X = Y"
  assumes "\<And>x. x \<in> Y \<Longrightarrow> f x = g x"
  assumes "sets M = sets N"
  shows "vimage_algebra X f M = vimage_algebra Y g N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vimage_algebra X f M = vimage_algebra Y g N
[PROOF STEP]
by (auto simp: vimage_algebra_def assms intro!: arg_cong2[where f=sigma])


[STATEMENT]
lemma length_takeWhile_less:
  "\<exists>x\<in>set xs. \<not> P x \<Longrightarrow> length (takeWhile P xs) < length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>set xs. \<not> P x \<Longrightarrow> length (takeWhile P xs) < length xs
[PROOF STEP]
by (induct xs) (auto split: if_splits)


[STATEMENT]
lemma path_connectedin_Euclidean_complements:
  assumes "closedin (Euclidean_space n) S" "closedin (Euclidean_space n) T"
          "(subtopology (Euclidean_space n) S) homeomorphic_space (subtopology (Euclidean_space n) T)"
  shows "path_connectedin (Euclidean_space n) (topspace(Euclidean_space n) - S)
         \<longleftrightarrow> path_connectedin (Euclidean_space n) (topspace(Euclidean_space n) - T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connectedin (Euclidean_space n) (topspace (Euclidean_space n) - S) = path_connectedin (Euclidean_space n) (topspace (Euclidean_space n) - T)
[PROOF STEP]
by (meson Diff_subset assms isomorphic_homology_groups_Euclidean_complements isomorphic_homology_imp_path_connectedness path_connectedin_def)


[STATEMENT]
lemma coeff_powsum_mpoly_0_right:
  "MPoly_Type.coeff (powsum_mpoly X 0) mon = (if mon = 0 then of_nat (card X) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeff (powsum_mpoly X 0) mon = (if mon = 0 then of_nat (card X) else (0::'a))
[PROOF STEP]
by transfer' (auto simp add: lookup_powsum_mpoly_aux)


[STATEMENT]
lemma (in Module) l_comb_mem:"\<lbrakk>ideal R A; H \<subseteq> carrier M;
       s \<in> {j. j \<le> (n::nat)} \<rightarrow> A; m \<in> {j. j \<le> n} \<rightarrow> H\<rbrakk> \<Longrightarrow>
      l_comb R M n s m \<in> carrier M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> A; m \<in> {j. j \<le> n} \<rightarrow> H\<rbrakk> \<Longrightarrow> l_comb R M n s m \<in> carrier M
[PROOF STEP]
apply (simp add:liear_comb_memTr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma is_aligned_replicate:
  fixes w::"'a::len word"
  assumes aligned: "is_aligned w n"
  and          nv: "n \<le> LENGTH('a)"
  shows   "to_bl w = (take (LENGTH('a) - n) (to_bl w)) @ replicate n False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl w = take (LENGTH('a) - n) (to_bl w) @ replicate n False
[PROOF STEP]
apply (rule nth_equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (to_bl w) = length (take (LENGTH('a) - n) (to_bl w) @ replicate n False)
 2. \<And>i. i < length (to_bl w) \<Longrightarrow> to_bl w ! i = (take (LENGTH('a) - n) (to_bl w) @ replicate n False) ! i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_aligned w n
n \<le> LENGTH('a)

goal (2 subgoals):
 1. length (to_bl w) = length (take (LENGTH('a) - n) (to_bl w) @ replicate n False)
 2. \<And>i. i < length (to_bl w) \<Longrightarrow> to_bl w ! i = (take (LENGTH('a) - n) (to_bl w) @ replicate n False) ! i
[PROOF STEP]
apply (simp_all add: nth_append not_less word_size to_bl_nth is_aligned_imp_not_bit)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma same_carrierI:
  assumes "finite C"
  assumes subset: "A \<subseteq> C" "B \<subseteq> C"
  assumes trivial: "\<And>a. a \<in> C - A \<Longrightarrow> g a = \<^bold>1" "\<And>b. b \<in> C - B \<Longrightarrow> h b = \<^bold>1"
  assumes "F g C = F h C"
  shows "F g A = F h B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F g A = F h B
[PROOF STEP]
using assms same_carrier [of C A B]
[PROOF STATE]
proof (prove)
using this:
finite C
A \<subseteq> C
B \<subseteq> C
?a1 \<in> C - A \<Longrightarrow> g ?a1 = \<^bold>1
?b1 \<in> C - B \<Longrightarrow> h ?b1 = \<^bold>1
F g C = F h C
\<lbrakk>finite C; A \<subseteq> C; B \<subseteq> C; \<And>a. a \<in> C - A \<Longrightarrow> ?g a = \<^bold>1; \<And>b. b \<in> C - B \<Longrightarrow> ?h b = \<^bold>1\<rbrakk> \<Longrightarrow> (F ?g A = F ?h B) = (F ?g C = F ?h C)

goal (1 subgoal):
 1. F g A = F h B
[PROOF STEP]
by simp


[STATEMENT]
lemma sup_lub:
  assumes "A \<subseteq> carrier L"
  shows "least L (\<Squnion>A) (Upper L A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_lub L (\<Squnion>A) A
[PROOF STEP]
by (metis Upper_is_closed assms least_closed least_cong supI sup_closed sup_exists weak_least_unique)


[STATEMENT]
lemma zdiv_le_dividend:
  \<open>0 \<le> a \<Longrightarrow> 0 < b \<Longrightarrow> a div b \<le> a\<close> for a b :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; 0 < b\<rbrakk> \<Longrightarrow> a div b \<le> a
[PROOF STEP]
by (metis div_by_1 int_one_le_iff_zero_less zdiv_mono2 zero_less_one)


[STATEMENT]
lemma divide_strict_left_mono_neg:
  "a < b \<Longrightarrow> c < 0 \<Longrightarrow> 0 < a*b \<Longrightarrow> c / a < c / b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; c < (0::'a); (0::'a) < a * b\<rbrakk> \<Longrightarrow> c / a < c / b
[PROOF STEP]
by (metis local.divide_strict_left_mono local.minus_divide_left local.neg_0_less_iff_less local.neg_less_iff_less mult_commute)


[STATEMENT]
lemma card_face_cycle_sets_da: "Suc (card H.face_cycle_sets) \<ge> (card G.face_cycle_sets)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card G.face_cycle_sets \<le> Suc (card H.face_cycle_sets)
[PROOF STEP]
unfolding card_face_cycle_sets_da'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card G.face_cycle_sets \<le> Suc (card G.face_cycle_sets - 1 + card ({segment G.face_cycle_succ a a', segment G.face_cycle_succ a' a, {}} - {{}}))
[PROOF STEP]
using card_fcs_gt_0
[PROOF STATE]
proof (prove)
using this:
0 < card G.face_cycle_sets

goal (1 subgoal):
 1. card G.face_cycle_sets \<le> Suc (card G.face_cycle_sets - 1 + card ({segment G.face_cycle_succ a a', segment G.face_cycle_succ a' a, {}} - {{}}))
[PROOF STEP]
by linarith


[STATEMENT]
lemma vector_space_pair_with_overloaded[ud_with]:
  "vector_space_pair =
    (
      \<lambda>scale\<^sub>1 scale\<^sub>2.
        vector_space_pair_with (+) 0 (-) uminus scale\<^sub>1 (+) 0 (-) uminus scale\<^sub>2
    )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_space_pair = (\<lambda>scale\<^sub>1. vector_space_pair_with (+) (0::'b) (-) uminus scale\<^sub>1 (+) (0::'c) (-) uminus)
[PROOF STEP]
unfolding vector_space_pair_def vector_space_pair_with_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>s1 s2. vector_space s1 \<and> vector_space s2) = (\<lambda>scale\<^sub>1 scale\<^sub>2. vector_space_with (+) (0::'b) (-) uminus scale\<^sub>1 \<and> vector_space_with (+) (0::'c) (-) uminus scale\<^sub>2)
[PROOF STEP]
unfolding vector_space_with_overloaded
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>s1 s2. vector_space_with (+) (0::'b) (-) uminus s1 \<and> vector_space_with (+) (0::'c) (-) uminus s2) = (\<lambda>scale\<^sub>1 scale\<^sub>2. vector_space_with (+) (0::'b) (-) uminus scale\<^sub>1 \<and> vector_space_with (+) (0::'c) (-) uminus scale\<^sub>2)
[PROOF STEP]
..


[STATEMENT]
lemma affine_alg_set_subset_zero_set:
  assumes "b \<in> as"
  shows " affine_alg_set R n as \<subseteq> (zero_set R n b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_alg_set R n as \<subseteq> V n b
[PROOF STEP]
using assms affine_alg_set_def
[PROOF STATE]
proof (prove)
using this:
b \<in> as
affine_alg_set ?R ?n ?as = {a \<in> carrier (?R\<^bsup>?n\<^esup>). \<forall>b\<in>?as. a \<in> V\<^bsub>?R\<^esub> ?n b}

goal (1 subgoal):
 1. affine_alg_set R n as \<subseteq> V n b
[PROOF STEP]
by blast


[STATEMENT]
lemma isGlbD2: "isGlb R S x \<Longrightarrow> y \<in> S \<Longrightarrow> y \<ge> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isGlb R S x; y \<in> S\<rbrakk> \<Longrightarrow> x \<le> y
[PROOF STEP]
by (blast dest!: isGlbD1 setgeD)


[STATEMENT]
lemma urel64_mod:
assumes x: "urel64 x x'" and y: "urel64 y y'"
shows "urel64 (if y = 0 then x else 0) (if y' = 0 then x' else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel64 (if y = 0 then x else 0) (if y' = 0 then x' else 0)
[PROOF STEP]
unfolding urel64_eq[OF y urel64_0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel64 (if y' = 0 then x else 0) (if y' = 0 then x' else 0)
[PROOF STEP]
using urel64_0 x
[PROOF STATE]
proof (prove)
using this:
urel64 0 0
urel64 x x'

goal (1 subgoal):
 1. urel64 (if y' = 0 then x else 0) (if y' = 0 then x' else 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma integral_return:
  fixes g :: "_ \<Rightarrow> 'a :: {banach, second_countable_topology}"
  assumes "x \<in> space M" "g \<in> borel_measurable M"
  shows "(\<integral>a. g a \<partial>return M x) = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (return M x) g = g x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>L (return M x) g = g x
[PROOF STEP]
interpret prob_space "return M x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (return M x)
[PROOF STEP]
by (rule prob_space_return[OF \<open>x \<in> space M\<close>])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. expectation g = g x
[PROOF STEP]
have "(\<integral>a. g a \<partial>return M x) = (\<integral>a. g x \<partial>return M x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation g = expectation (\<lambda>a. g x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> space M
g \<in> borel_measurable M

goal (1 subgoal):
 1. expectation g = expectation (\<lambda>a. g x)
[PROOF STEP]
by (intro integral_cong_AE) (auto simp: AE_return)
[PROOF STATE]
proof (state)
this:
expectation g = expectation (\<lambda>a. g x)

goal (1 subgoal):
 1. expectation g = g x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
expectation g = expectation (\<lambda>a. g x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
expectation g = expectation (\<lambda>a. g x)

goal (1 subgoal):
 1. expectation g = g x
[PROOF STEP]
using prob_space
[PROOF STATE]
proof (prove)
using this:
expectation g = expectation (\<lambda>a. g x)
prob (space (return M x)) = 1

goal (1 subgoal):
 1. expectation g = g x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
expectation g = g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_index'_eq_conv[simp]:
  "map_index' i f xs = map_index' j g xs = (\<forall>k < length xs. f (i + k) (xs ! k) = g (j + k) (xs ! k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_index' i f xs = map_index' j g xs) = (\<forall>k<length xs. f (i + k) (xs ! k) = g (j + k) (xs ! k))
[PROOF STEP]
proof (induct xs arbitrary: i j)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i j. (map_index' i f [] = map_index' j g []) = (\<forall>k<length []. f (i + k) ([] ! k) = g (j + k) ([] ! k))
 2. \<And>a xs i j. (\<And>i j. (map_index' i f xs = map_index' j g xs) = (\<forall>k<length xs. f (i + k) (xs ! k) = g (j + k) (xs ! k))) \<Longrightarrow> (map_index' i f (a # xs) = map_index' j g (a # xs)) = (\<forall>k<length (a # xs). f (i + k) ((a # xs) ! k) = g (j + k) ((a # xs) ! k))
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
(map_index' ?i f xs_ = map_index' ?j g xs_) = (\<forall>k<length xs_. f (?i + k) (xs_ ! k) = g (?j + k) (xs_ ! k))

goal (2 subgoals):
 1. \<And>i j. (map_index' i f [] = map_index' j g []) = (\<forall>k<length []. f (i + k) ([] ! k) = g (j + k) ([] ! k))
 2. \<And>a xs i j. (\<And>i j. (map_index' i f xs = map_index' j g xs) = (\<forall>k<length xs. f (i + k) (xs ! k) = g (j + k) (xs ! k))) \<Longrightarrow> (map_index' i f (a # xs) = map_index' j g (a # xs)) = (\<forall>k<length (a # xs). f (i + k) ((a # xs) ! k) = g (j + k) ((a # xs) ! k))
[PROOF STEP]
from Cons(1)[of "Suc i" "Suc j"]
[PROOF STATE]
proof (chain)
picking this:
(map_index' (Suc i) f xs_ = map_index' (Suc j) g xs_) = (\<forall>k<length xs_. f (Suc i + k) (xs_ ! k) = g (Suc j + k) (xs_ ! k))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(map_index' (Suc i) f xs_ = map_index' (Suc j) g xs_) = (\<forall>k<length xs_. f (Suc i + k) (xs_ ! k) = g (Suc j + k) (xs_ ! k))

goal (1 subgoal):
 1. (map_index' i f (a_ # xs_) = map_index' j g (a_ # xs_)) = (\<forall>k<length (a_ # xs_). f (i + k) ((a_ # xs_) ! k) = g (j + k) ((a_ # xs_) ! k))
[PROOF STEP]
by (auto simp: nth_Cons split: nat.splits)
[PROOF STATE]
proof (state)
this:
(map_index' i f (a_ # xs_) = map_index' j g (a_ # xs_)) = (\<forall>k<length (a_ # xs_). f (i + k) ((a_ # xs_) ! k) = g (j + k) ((a_ # xs_) ! k))

goal (1 subgoal):
 1. \<And>i j. (map_index' i f [] = map_index' j g []) = (\<forall>k<length []. f (i + k) ([] ! k) = g (j + k) ([] ! k))
[PROOF STEP]
qed simp


[STATEMENT]
lemma floor_greatest_real: "floor(r::real) = (GREATEST i. i \<le> r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>r\<rfloor> = (GREATEST i. real_of_int i \<le> r)
[PROOF STEP]
by (metis Greatest_equality le_floor_iff of_int_floor_le)


[STATEMENT]
lemma Limsup_add_ereal_right:
  "F \<noteq> bot \<Longrightarrow> abs c \<noteq> \<infinity> \<Longrightarrow> Limsup F (\<lambda>n. g n + (c :: ereal)) = Limsup F g + c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<noteq> bot; \<bar>c\<bar> \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> Limsup F (\<lambda>n. g n + c) = Limsup F g + c
[PROOF STEP]
by (rule Limsup_compose_continuous_mono) (auto simp: mono_def add_mono continuous_on_def)


[STATEMENT]
lemma approx_mult_HFinite: "a \<approx> b \<Longrightarrow> c \<approx> d \<Longrightarrow> b \<in> HFinite \<Longrightarrow> d \<in> HFinite \<Longrightarrow> a * c \<approx> b * d"
  for a b c d :: "'a::real_normed_algebra star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<approx> b; c \<approx> d; b \<in> HFinite; d \<in> HFinite\<rbrakk> \<Longrightarrow> a * c \<approx> b * d
[PROOF STEP]
by (meson approx_HFinite approx_mult2 approx_mult_subst2 approx_sym)


[STATEMENT]
lemma length_eq_card_rows:
  fixes A::"'a^'columns::{mod_type}^'rows::{mod_type}"
  shows "IArray.length (matrix_to_iarray A) = CARD('rows)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (matrix_to_iarray A) = CARD('rows)
[PROOF STEP]
unfolding matrix_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (IArray (map (vec_to_iarray \<circ> ($) A \<circ> mod_type_class.from_nat) [0..<CARD('rows)])) = CARD('rows)
[PROOF STEP]
by auto


[STATEMENT]
lemma nat_to_bv_length_bv_to_nat:
  "length xs = n \<Longrightarrow> xs \<noteq> [] \<Longrightarrow> nat_to_bv_length (bv_to_nat xs) n = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = n; xs \<noteq> []\<rbrakk> \<Longrightarrow> nat_to_bv_length (bv_to_nat xs) n = xs
[PROOF STEP]
apply (simp only: nat_to_bv_length)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = n; xs \<noteq> []\<rbrakk> \<Longrightarrow> (if length (nat_to_bv (bv_to_nat xs)) \<le> n then bv_extend n \<zero> (nat_to_bv (bv_to_nat xs)) else []) = xs
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<noteq> []; n = length xs\<rbrakk> \<Longrightarrow> bv_extend (length xs) \<zero> (norm_unsigned xs) = xs
[PROOF STEP]
apply (simp add: bv_extend_norm_unsigned)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mult_scalar_sum_monomials: "q \<odot> p = (\<Sum>t\<in>keys q. monom_mult (lookup q t) t p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<odot> p = (\<Sum>t\<in>keys q. monom_mult (lookup q t) t p)
[PROOF STEP]
by (rule poly_mapping_eqI_proj, simp add: proj_sum mult_scalar_monomial[symmetric]
      sum_distrib_right[symmetric] poly_mapping_sum_monomials term_simps)


[STATEMENT]
lemma nxt_wait:
assumes "ev \<phi> xs"  shows "(nxt ^^ (wait \<phi> xs)) \<phi> xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nxt ^^ wait \<phi> xs) \<phi> xs
[PROOF STEP]
unfolding wait_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nxt ^^ (LEAST n. (nxt ^^ n) \<phi> xs)) \<phi> xs
[PROOF STEP]
using ev_ex_nxt[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>n. (nxt ^^ n) \<phi> xs

goal (1 subgoal):
 1. (nxt ^^ (LEAST n. (nxt ^^ n) \<phi> xs)) \<phi> xs
[PROOF STEP]
by(rule LeastI_ex)


[STATEMENT]
lemma angular_component_p_int_pow:
"angular_component (\<pp> [^] (n::int)) = \<one>\<^bsub>Z\<^sub>p\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. angular_component (\<pp> [^] n) = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
apply(cases "n \<ge> 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> angular_component (\<pp> [^] n) = \<one>\<^bsub>Z\<^sub>p\<^esub>
 2. \<not> 0 \<le> n \<Longrightarrow> angular_component (\<pp> [^] n) = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
apply (metis angular_component_p_nat_pow int_pow_int nonneg_int_cases)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> angular_component (\<pp> [^] n) = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
using angular_component_p_nat_pow[of "nat (-n)"] angular_component_inv[of "(\<pp> [^] n)"] angular_component_inv[of "\<pp> [^] (nat (-n))"]
[PROOF STATE]
proof (prove)
using this:
angular_component (\<pp> [^] nat (- n)) = \<one>\<^bsub>Z\<^sub>p\<^esub>
\<pp> [^] n \<in> nonzero Q\<^sub>p \<Longrightarrow> angular_component (inv (\<pp> [^] n)) = inv\<^bsub>Z\<^sub>p\<^esub> angular_component (\<pp> [^] n)
\<pp> [^] nat (- n) \<in> nonzero Q\<^sub>p \<Longrightarrow> angular_component (inv (\<pp> [^] nat (- n))) = inv\<^bsub>Z\<^sub>p\<^esub> angular_component (\<pp> [^] nat (- n))

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> angular_component (\<pp> [^] n) = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) Group.nat_pow_0 Zp.inv_one add.inverse_neutral angular_component_one int_nat_eq
      int_pow_def2 nat_0_iff nat_int nat_zminus_int p_natpow_closed(2) )


[STATEMENT]
lemma vrange_iso_is_arr':
  assumes "F : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> B"
    and "B' = \<R>\<^sub>\<circ> (F\<lparr>ArrVal\<rparr>)"
    and "\<CC>' = cat_Set \<alpha>"
  shows "vrange_iso F : B' \<mapsto>\<^bsub>\<CC>'\<^esub> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vrange_iso F : B' \<mapsto>\<^bsub>\<CC>'\<^esub> A
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
F : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> B

goal (1 subgoal):
 1. vrange_iso F : B' \<mapsto>\<^bsub>\<CC>'\<^esub> A
[PROOF STEP]
unfolding assms(2,3)
[PROOF STATE]
proof (prove)
using this:
F : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> B

goal (1 subgoal):
 1. vrange_iso F : \<R>\<^sub>\<circ> (F\<lparr>ArrVal\<rparr>) \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> A
[PROOF STEP]
by (rule vrange_iso_is_arr)


[STATEMENT]
lemma closed_positive_orthant: "closed {x::real^'n. \<forall>i. 0 \<le>x$i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. \<forall>i. 0 \<le> x $ i}
[PROOF STEP]
by (simp add: Collect_all_eq closed_INT closed_Collect_le continuous_on_component)


[STATEMENT]
lemma vreal_distributive_law:
  assumes "x \<in>\<^sub>\<circ> \<real>\<^sub>\<circ>" and "y \<in>\<^sub>\<circ> \<real>\<^sub>\<circ>" and "z \<in>\<^sub>\<circ> \<real>\<^sub>\<circ>"
  shows "x *\<^sub>\<real> (y +\<^sub>\<real> z) = x *\<^sub>\<real> y +\<^sub>\<real> x *\<^sub>\<real> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>\<real> (y +\<^sub>\<real> z) = x *\<^sub>\<real> y +\<^sub>\<real> x *\<^sub>\<real> z
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x *\<^sub>\<real> (y +\<^sub>\<real> z) = x *\<^sub>\<real> y +\<^sub>\<real> x *\<^sub>\<real> z
[PROOF STEP]
have "x' * (y' + z') = (x' * y') + (x' * z')" for x' y' z' :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' * (y' + z') = x' * y' + x' * z'
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
?x' * (?y' + ?z') = ?x' * ?y' + ?x' * ?z'

goal (1 subgoal):
 1. x *\<^sub>\<real> (y +\<^sub>\<real> z) = x *\<^sub>\<real> y +\<^sub>\<real> x *\<^sub>\<real> z
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x *\<^sub>\<real> (y +\<^sub>\<real> z) = x *\<^sub>\<real> y +\<^sub>\<real> x *\<^sub>\<real> z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x *\<^sub>\<real> (y +\<^sub>\<real> z) = x *\<^sub>\<real> y +\<^sub>\<real> x *\<^sub>\<real> z

goal (1 subgoal):
 1. x *\<^sub>\<real> (y +\<^sub>\<real> z) = x *\<^sub>\<real> y +\<^sub>\<real> x *\<^sub>\<real> z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x *\<^sub>\<real> (y +\<^sub>\<real> z) = x *\<^sub>\<real> y +\<^sub>\<real> x *\<^sub>\<real> z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vifintersection_vdoubleton_is[simp]: "(\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>set {i, j}. f i) = f i \<inter>\<^sub>\<circ> f j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter>\<^sub>\<circ> (VLambda (set {i, j}) f `\<^sub>\<circ> set {i, j}) = f i \<inter>\<^sub>\<circ> f j
[PROOF STEP]
by
    (
      intro vsubset_antisym vsubsetI;
      (elim vifintersectionE3 | intro vifintersectionI)
    )
    auto


[STATEMENT]
lemma int_div_same_is_1 [simp]:
  \<open>a div b = a \<longleftrightarrow> b = 1\<close> if \<open>0 < a\<close> for a b :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a div b = a) = (b = 1)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. (a div b = a) = (b = 1)
[PROOF STEP]
by (metis div_by_1 abs_ge_zero abs_of_pos int_div_less_self neq_iff
            nonneg1_imp_zdiv_pos_iff zabs_less_one_iff)


[STATEMENT]
lemma (in proper_design) t_wise_balanceI[intro]: "\<t> \<le> \<v> \<Longrightarrow> \<t> \<ge> 1 \<Longrightarrow>
  (\<And> ps . ps \<subseteq> \<V> \<Longrightarrow> card ps = \<t>  \<Longrightarrow> \<B> index ps = \<Lambda>\<^sub>t) \<Longrightarrow> t_wise_balance \<V> \<B> \<t> \<Lambda>\<^sub>t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<t> \<le> \<v>; 1 \<le> \<t>; \<And>ps. \<lbrakk>ps \<subseteq> \<V>; card ps = \<t>\<rbrakk> \<Longrightarrow> \<B> index ps = \<Lambda>\<^sub>t\<rbrakk> \<Longrightarrow> t_wise_balance \<V> \<B> \<t> \<Lambda>\<^sub>t
[PROOF STEP]
by (unfold_locales) auto


[STATEMENT]
lemma derivation_const_eq_zero: "X (restrict0 carrier (\<lambda>x. c)) = 0"
  if "X \<in> tangent_space p" "p \<in> carrier"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
note scaleR = diff_fun_space.linear_scale[OF _ _ tangent_space_linear_on[OF that(1)]]
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>x. x \<in> diff_fun_space \<longrightarrow> X x \<in> UNIV; ?b \<in> diff_fun_space\<rbrakk> \<Longrightarrow> X (?r *\<^sub>R ?b) = ?r *\<^sub>R X ?b

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
have "X (c *\<^sub>R (restrict0 carrier (\<lambda>x. 1))) = c *\<^sub>R X (restrict0 carrier (\<lambda>x. 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X (c *\<^sub>R restrict0 carrier (\<lambda>x. 1)) = c *\<^sub>R X (restrict0 carrier (\<lambda>x. 1))
[PROOF STEP]
by (rule scaleR) (auto intro!: restrict0_const_diff_fun_space)
[PROOF STATE]
proof (state)
this:
X (c *\<^sub>R restrict0 carrier (\<lambda>x. 1)) = c *\<^sub>R X (restrict0 carrier (\<lambda>x. 1))

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X (c *\<^sub>R restrict0 carrier (\<lambda>x. 1)) = c *\<^sub>R X (restrict0 carrier (\<lambda>x. 1))

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
note derivation_one_eq_zero[OF that]
[PROOF STATE]
proof (state)
this:
X (restrict0 carrier (\<lambda>x. 1)) = 0

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X (restrict0 carrier (\<lambda>x. 1)) = 0

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
note restrict0_scaleR[symmetric]
[PROOF STATE]
proof (state)
this:
?c *\<^sub>R restrict0 ?A ?f = restrict0 ?A (?c *\<^sub>R ?f)

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
X (restrict0 carrier (c *\<^sub>R (\<lambda>a. 1))) = c *\<^sub>R 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X (restrict0 carrier (c *\<^sub>R (\<lambda>a. 1))) = c *\<^sub>R 0

goal (1 subgoal):
 1. X (restrict0 carrier (\<lambda>x. c)) = 0
[PROOF STEP]
by (auto simp: scaleR_fun_def)
[PROOF STATE]
proof (state)
this:
X (restrict0 carrier (\<lambda>x. c)) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma face_of_trans [trans]: "\<lbrakk>S face_of T; T face_of u\<rbrakk> \<Longrightarrow> S face_of u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S face_of T; T face_of u\<rbrakk> \<Longrightarrow> S face_of u
[PROOF STEP]
unfolding face_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T \<and> convex S \<and> (\<forall>a\<in>T. \<forall>b\<in>T. \<forall>x\<in>S. x \<in> open_segment a b \<longrightarrow> a \<in> S \<and> b \<in> S); T \<subseteq> u \<and> convex T \<and> (\<forall>a\<in>u. \<forall>b\<in>u. \<forall>x\<in>T. x \<in> open_segment a b \<longrightarrow> a \<in> T \<and> b \<in> T)\<rbrakk> \<Longrightarrow> S \<subseteq> u \<and> convex S \<and> (\<forall>a\<in>u. \<forall>b\<in>u. \<forall>x\<in>S. x \<in> open_segment a b \<longrightarrow> a \<in> S \<and> b \<in> S)
[PROOF STEP]
by (safe; blast)


[STATEMENT]
lemma psi_conv_pre_mangoldt: "psi n = ln (real (prod pre_mangoldt {1..n}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi n = ln (real (prod pre_mangoldt {1..n}))
[PROOF STEP]
by (auto simp: psi_def mangoldt_def pre_mangoldt_def ln_prod primepow_gt_Suc_0 intro!: sum.cong)


[STATEMENT]
lemma index_image: "distinct xs \<Longrightarrow> set xs = X \<Longrightarrow> index xs ` X = {0..<size xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; set xs = X\<rbrakk> \<Longrightarrow> index xs ` X = {0..<length xs}
[PROOF STEP]
by (simp add: bij_betw_imp_surj_on bij_betw_index)


[STATEMENT]
lemma exec_exec_max: "\<lbrakk>s1 -c1-    n1   \<rightarrow> t1 ; s2 -c2-       n2\<rightarrow> t2\<rbrakk> \<Longrightarrow>
                       s1 -c1-max n1 n2\<rightarrow> t1 \<and> s2 -c2-max n1 n2\<rightarrow> t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s1 -c1-n1\<rightarrow> t1; s2 -c2-n2\<rightarrow> t2\<rbrakk> \<Longrightarrow> s1 -c1-max n1 n2\<rightarrow> t1 \<and> s2 -c2-max n1 n2\<rightarrow> t2
[PROOF STEP]
by (fast intro: exec_mono max.cobounded1 max.cobounded2)


[STATEMENT]
lemma word_mult_less_iff:
  fixes i :: "'a :: len word"
  assumes knz: "0 < k"
  and     uik: "unat i * unat k < 2 ^ len_of TYPE ('a)"
  and     ujk: "unat j * unat k < 2 ^ len_of TYPE ('a)"
  shows  "(i * k < j * k) = (i < j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i * k < j * k) = (i < j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < k
unat i * unat k < 2 ^ LENGTH('a)
unat j * unat k < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. (i * k < j * k) = (i < j)
[PROOF STEP]
by (rule word_mult_less_cancel)


[STATEMENT]
lemma of_hypnat_le_iff [simp]:
  "\<And>m n. of_hypnat m \<le> (of_hypnat n::'a::linordered_semidom star) \<longleftrightarrow> m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. (of_hypnat m \<le> of_hypnat n) = (m \<le> n)
[PROOF STEP]
by transfer (rule of_nat_le_iff)


[STATEMENT]
lemma leadsETo_Union_distrib:
     "F \<in> (\<Union>S) leadsTo[CC] B  =  (\<forall>A\<in>S. F \<in> A leadsTo[CC] B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<in> \<Union> S leadsTo[CC] B) = (\<forall>A\<in>S. F \<in> A leadsTo[CC] B)
[PROOF STEP]
by (blast intro: leadsETo_Union leadsETo_weaken_L)


[STATEMENT]
lemma borel_measurable_halfspacesI:
  fixes f :: "'a \<Rightarrow> 'c::euclidean_space"
  assumes F: "borel = sigma UNIV (F ` (UNIV \<times> Basis))"
  and S_eq: "\<And>a i. S a i = f -` F (a,i) \<inter> space M"
  shows "f \<in> borel_measurable M = (\<forall>i\<in>Basis. \<forall>a::real. S a i \<in> sets M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> borel_measurable M) = (\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i a. \<lbrakk>f \<in> borel_measurable M; i \<in> Basis\<rbrakk> \<Longrightarrow> S a i \<in> sets M
 2. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
fix a :: real and i :: 'b
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i a. \<lbrakk>f \<in> borel_measurable M; i \<in> Basis\<rbrakk> \<Longrightarrow> S a i \<in> sets M
 2. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
assume i: "i \<in> Basis" and f: "f \<in> borel_measurable M"
[PROOF STATE]
proof (state)
this:
i \<in> Basis
f \<in> borel_measurable M

goal (2 subgoals):
 1. \<And>i a. \<lbrakk>f \<in> borel_measurable M; i \<in> Basis\<rbrakk> \<Longrightarrow> S a i \<in> sets M
 2. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> Basis
f \<in> borel_measurable M
[PROOF STEP]
show "S a i \<in> sets M"
[PROOF STATE]
proof (prove)
using this:
i \<in> Basis
f \<in> borel_measurable M

goal (1 subgoal):
 1. S a i \<in> sets M
[PROOF STEP]
unfolding assms
[PROOF STATE]
proof (prove)
using this:
i \<in> Basis
f \<in> M \<rightarrow>\<^sub>M sigma UNIV (F ` (UNIV \<times> Basis))

goal (1 subgoal):
 1. f -` F (a, i) \<inter> space M \<in> sets M
[PROOF STEP]
by (auto intro!: measurable_sets simp: assms(1))
[PROOF STATE]
proof (state)
this:
S a i \<in> sets M

goal (1 subgoal):
 1. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
assume a: "\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M"
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M

goal (1 subgoal):
 1. \<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M \<Longrightarrow> f \<in> borel_measurable M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M
[PROOF STEP]
show "f \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M

goal (1 subgoal):
 1. f \<in> borel_measurable M
[PROOF STEP]
by (auto intro!: measurable_measure_of simp: S_eq F)
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma simple_ports_conjunct_correct:
    "simple_match_port p1 pkt \<and> simple_match_port p2 pkt \<longleftrightarrow> simple_match_port (simpl_ports_conjunct p1 p2) pkt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (simple_match_port p1 pkt \<and> simple_match_port p2 pkt) = simple_match_port (simpl_ports_conjunct p1 p2) pkt
[PROOF STEP]
apply(cases p1, cases p2, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>p1 = (a, b); p2 = (aa, ba)\<rbrakk> \<Longrightarrow> (a \<le> pkt \<and> pkt \<le> b \<and> aa \<le> pkt \<and> pkt \<le> ba) = (a \<le> pkt \<and> aa \<le> pkt \<and> pkt \<le> b \<and> pkt \<le> ba)
[PROOF STEP]
by blast


[STATEMENT]
theorem wls_vsubstAbs_simp[simp]:
assumes "wls s X" and
        "xs \<noteq> ys \<or> x \<notin> {y,y1}"
shows "((Abs xs x X) $[y1 // y]_ys) = Abs xs x (X #[y1 // y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs xs x X $[y1 // y]_ys = Abs xs x (X #[y1 // y]_ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
xs \<noteq> ys \<or> x \<notin> {y, y1}

goal (1 subgoal):
 1. Abs xs x X $[y1 // y]_ys = Abs xs x (X #[y1 // y]_ys)
[PROOF STEP]
unfolding vsubst_def vsubstAbs_def
[PROOF STATE]
proof (prove)
using this:
wls s X
xs \<noteq> ys \<or> x \<notin> {y, y1}

goal (1 subgoal):
 1. Abs xs x X $[Var ys y1 / y]_ys = Abs xs x (X #[Var ys y1 / y]_ys)
[PROOF STEP]
by simp