[STATEMENT]
lemma elementary_union:
  fixes S T :: "'a::euclidean_space set"
  assumes "ps division_of S" "pt division_of T"
  obtains p where "p division_of (S \<union> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. p division_of S \<union> T \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>p. p division_of S \<union> T \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have *: "S \<union> T = \<Union>ps \<union> \<Union>pt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<union> T = \<Union> ps \<union> \<Union> pt
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ps division_of S
pt division_of T

goal (1 subgoal):
 1. S \<union> T = \<Union> ps \<union> \<Union> pt
[PROOF STEP]
unfolding division_of_def
[PROOF STATE]
proof (prove)
using this:
finite ps \<and> (\<forall>K\<in>ps. K \<subseteq> S \<and> K \<noteq> {} \<and> (\<exists>a b. K = cbox a b)) \<and> (\<forall>K1\<in>ps. \<forall>K2\<in>ps. K1 \<noteq> K2 \<longrightarrow> interior K1 \<inter> interior K2 = {}) \<and> \<Union> ps = S
finite pt \<and> (\<forall>K\<in>pt. K \<subseteq> T \<and> K \<noteq> {} \<and> (\<exists>a b. K = cbox a b)) \<and> (\<forall>K1\<in>pt. \<forall>K2\<in>pt. K1 \<noteq> K2 \<longrightarrow> interior K1 \<inter> interior K2 = {}) \<and> \<Union> pt = T

goal (1 subgoal):
 1. S \<union> T = \<Union> ps \<union> \<Union> pt
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<union> T = \<Union> ps \<union> \<Union> pt

goal (1 subgoal):
 1. (\<And>p. p division_of S \<union> T \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
apply (rule elementary_unions_intervals[of "ps \<union> pt"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite (ps \<union> pt)
 2. \<And>s. s \<in> ps \<union> pt \<Longrightarrow> \<exists>a b. s = cbox a b
 3. \<And>p. p division_of \<Union> (ps \<union> pt) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ps division_of S
pt division_of T

goal (3 subgoals):
 1. finite (ps \<union> pt)
 2. \<And>s. s \<in> ps \<union> pt \<Longrightarrow> \<exists>a b. s = cbox a b
 3. \<And>p. p division_of \<Union> (ps \<union> pt) \<Longrightarrow> thesis
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>p division_of \<Union> ps \<union> \<Union> pt; ps division_of S; pt division_of T\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (simp add: * that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem swapVal_commute:
"zs \<noteq> zs' \<or> {x,y} \<inter> {x',y'} = {} \<Longrightarrow>
 ((val ^[x \<and> y]_zs) ^[x' \<and> y']_zs') = ((val ^[x' \<and> y']_zs') ^[x \<and> y]_zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zs \<noteq> zs' \<or> {x, y} \<inter> {x', y'} = {} \<Longrightarrow> val ^[x \<and> y]_zs ^[x' \<and> y']_zs' = val ^[x' \<and> y']_zs' ^[x \<and> y]_zs
[PROOF STEP]
using swapVal_compose[of zs' x' y' zs x y val]
[PROOF STATE]
proof (prove)
using this:
val ^[x \<and> y]_zs ^[x' \<and> y']_zs' = val ^[x' @zs'[x \<and> y]_zs \<and> y' @zs'[x \<and> y]_zs]_zs' ^[x \<and> y]_zs

goal (1 subgoal):
 1. zs \<noteq> zs' \<or> {x, y} \<inter> {x', y'} = {} \<Longrightarrow> val ^[x \<and> y]_zs ^[x' \<and> y']_zs' = val ^[x' \<and> y']_zs' ^[x \<and> y]_zs
[PROOF STEP]
by(simp add: sw_def)


[STATEMENT]
lemma to_int_mod_ring_times: "to_int_mod_ring ((x :: 'a mod_ring) * y) = M (to_int_mod_ring x * to_int_mod_ring y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mod_ring (x * y) = M (to_int_mod_ring x * to_int_mod_ring y)
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mod_ring (x * y) = to_int_mod_ring x * to_int_mod_ring y mod m
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
m = int CARD('a)

goal (1 subgoal):
 1. to_int_mod_ring (x * y) = to_int_mod_ring x * to_int_mod_ring y mod m
[PROOF STEP]
by (transfer, auto)


[STATEMENT]
lemma vector_sadd_rdistrib: "((a::'a::semiring) + b) *s x = a *s x + b *s x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b) *s x = a *s x + b *s x
[PROOF STEP]
by (vector field_simps)


[STATEMENT]
lemma integrable_by_parts:
  fixes prod :: "_ \<Rightarrow> _ \<Rightarrow> 'b :: banach"
  assumes "bounded_bilinear (prod)" "a \<le> b"
          "continuous_on {a..b} f" "continuous_on {a..b} g"
  assumes "\<And>x. x\<in>{a..b} \<Longrightarrow> (f has_vector_derivative f' x) (at x)"
          "\<And>x. x\<in>{a..b} \<Longrightarrow> (g has_vector_derivative g' x) (at x)"
  assumes "(\<lambda>x. prod (f x) (g' x)) integrable_on {a..b}"
  shows   "(\<lambda>x. prod (f' x) (g x)) integrable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. prod (f' x) (g x)) integrable_on {a..b}
[PROOF STEP]
by (rule integrable_by_parts_interior_strong[of _ "{}" _ _ f g f' g']) (insert assms, simp_all)


[STATEMENT]
lemma numeral_7_eq_7: "7 = Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 7 = Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))
[PROOF STEP]
by (simp add: eval_nat_numeral)


[STATEMENT]
lemma quasinorm_intersection_space:
  "space\<^sub>N (N1 \<inter>\<^sub>N N2) = space\<^sub>N N1 \<inter> space\<^sub>N N2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space\<^sub>N (N1 \<inter>\<^sub>N N2) = space\<^sub>N N1 \<inter> space\<^sub>N N2
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. x \<in> space\<^sub>N (N1 \<inter>\<^sub>N N2) \<Longrightarrow> x \<in> space\<^sub>N N1
 2. \<And>x. x \<in> space\<^sub>N (N1 \<inter>\<^sub>N N2) \<Longrightarrow> x \<in> space\<^sub>N N2
 3. \<And>x. \<lbrakk>x \<in> space\<^sub>N N1; x \<in> space\<^sub>N N2\<rbrakk> \<Longrightarrow> x \<in> space\<^sub>N (N1 \<inter>\<^sub>N N2)
[PROOF STEP]
unfolding quasinorm_intersection(1) spaceN_iff
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. eNorm N1 x + eNorm N2 x < \<infinity> \<Longrightarrow> eNorm N1 x < \<infinity>
 2. \<And>x. eNorm N1 x + eNorm N2 x < \<infinity> \<Longrightarrow> eNorm N2 x < \<infinity>
 3. \<And>x. \<lbrakk>eNorm N1 x < \<infinity>; eNorm N2 x < \<infinity>\<rbrakk> \<Longrightarrow> eNorm N1 x + eNorm N2 x < \<infinity>
[PROOF STEP]
by auto


[STATEMENT]
lemma fps_integral_linear:
  fixes a b a0 b0 :: "'a::division_ring"
  shows
  "fps_integral (fps_const a * f + fps_const b * g) (a*a0 + b*b0) =
    fps_const a * fps_integral f a0 + fps_const b * fps_integral g b0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_integral (fps_const a * f + fps_const b * g) (a * a0 + b * b0) = fps_const a * fps_integral f a0 + fps_const b * fps_integral g b0
[PROOF STEP]
using fps_integral_conv_plus_const[of
          "fps_const a * f + fps_const b * g"
          "a*a0 + b*b0"
        ]
        fps_integral_conv_plus_const[of f a0] fps_integral_conv_plus_const[of g b0]
[PROOF STATE]
proof (prove)
using this:
fps_integral (fps_const a * f + fps_const b * g) (a * a0 + b * b0) = fps_integral0 (fps_const a * f + fps_const b * g) + fps_const (a * a0 + b * b0)
fps_integral f a0 = fps_integral0 f + fps_const a0
fps_integral g b0 = fps_integral0 g + fps_const b0

goal (1 subgoal):
 1. fps_integral (fps_const a * f + fps_const b * g) (a * a0 + b * b0) = fps_const a * fps_integral f a0 + fps_const b * fps_integral g b0
[PROOF STEP]
by    (simp add: fps_integral0_linear algebra_simps)


[STATEMENT]
lemma Deriv_diff[simp]:
  shows "Deriv c (A - B) = Deriv c A - Deriv c B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Deriv c (A - B) = Deriv c A - Deriv c B
[PROOF STEP]
by(auto simp add: Deriv_def)


[STATEMENT]
lemma image_Suc_fvi: "Suc ` MFOTL.fvi (Suc b) \<phi> = MFOTL.fvi b \<phi> - {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc ` MFOTL.fvi (Suc b) \<phi> = MFOTL.fvi b \<phi> - {0}
[PROOF STEP]
by (auto simp: image_def Bex_def MFOTL.fvi_Suc dest: gr0_implies_Suc)


[STATEMENT]
lemma [code abstract]:
  "integer_of_natural (m - n) = max 0 (integer_of_natural m - integer_of_natural n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_natural (m - n) = max 0 (integer_of_natural m - integer_of_natural n)
[PROOF STEP]
by transfer simp


[STATEMENT]
theorem Wait_Wait: "Wait(m) ;; Wait(n) = Wait (m + n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Wait m ;; Wait n = Wait (m + n)
[PROOF STEP]
by (rel_auto)


[STATEMENT]
lemma image_group_one: "one (image_group f G) = f \<one>\<^bsub>G\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>image_group f G\<^esub> = f \<one>\<^bsub>G\<^esub>
[PROOF STEP]
unfolding image_group_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>\<lparr>carrier = f ` carrier G, mult = \<lambda>a b. f (inv_into (carrier G) f a \<otimes>\<^bsub>G\<^esub> inv_into (carrier G) f b), one = f \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> = f \<one>\<^bsub>G\<^esub>
[PROOF STEP]
by simp


[STATEMENT]
lemma mat_mult_code[code]: "A * B = (if dim_col A = dim_row B then strassen_mat_mult A B else basic_mat_mult A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B = (if dim_col A = dim_row B then strassen_mat_mult A B else basic_mat_mult A B)
[PROOF STEP]
using strassen_mat_mult[of A B]
[PROOF STATE]
proof (prove)
using this:
dim_col A = dim_row B \<Longrightarrow> strassen_mat_mult A B = A * B

goal (1 subgoal):
 1. A * B = (if dim_col A = dim_row B then strassen_mat_mult A B else basic_mat_mult A B)
[PROOF STEP]
unfolding basic_mat_mult_def
[PROOF STATE]
proof (prove)
using this:
dim_col A = dim_row B \<Longrightarrow> strassen_mat_mult A B = A * B

goal (1 subgoal):
 1. A * B = (if dim_col A = dim_row B then strassen_mat_mult A B else A * B)
[PROOF STEP]
by auto


[STATEMENT]
lemma Fract_le_zero_iff: "0 < b \<Longrightarrow> Fract a b \<le> 0 \<longleftrightarrow> a \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b \<Longrightarrow> (Fract a b \<le> 0) = (a \<le> 0)
[PROOF STEP]
by (simp add: Zero_rat_def mult_le_0_iff)


[STATEMENT]
lemma to_nat_the_solve_consistent_rref:
fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
assumes rref: "reduced_row_echelon_form A"
and exists: "(\<exists>i. A $ i $ j = 1 \<and> j = (LEAST n. A $ i $ n \<noteq> 0))"
shows "to_nat (THE i. A $ i $ j = 1) = least_non_zero_position_of_vector (column_iarray (to_nat j) (matrix_to_iarray A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
obtain i where Aij: "A $ i $ j = 1" and j:"j = (LEAST n. A $ i $ n \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. \<lbrakk>A $ i $ j = (1::'a); j = (LEAST n. A $ i $ n \<noteq> (0::'a))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using exists
[PROOF STATE]
proof (prove)
using this:
\<exists>i. A $ i $ j = (1::'a) \<and> j = (LEAST n. A $ i $ n \<noteq> (0::'a))

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>A $ i $ j = (1::'a); j = (LEAST n. A $ i $ n \<noteq> (0::'a))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A $ i $ j = (1::'a)
j = (LEAST n. A $ i $ n \<noteq> (0::'a))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
have "least_non_zero_position_of_vector (column_iarray (to_nat j) (matrix_to_iarray A)) =
    least_non_zero_position_of_vector (vec_to_iarray (column j A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)) = least_non_zero_position_of_vector (vec_to_iarray (column j A))
[PROOF STEP]
unfolding vec_to_iarray_column
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)) = least_non_zero_position_of_vector (vec_to_iarray (column j A))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)) = least_non_zero_position_of_vector (vec_to_iarray (column j A))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
have "... = least_non_zero_position_of_vector_from_index (vec_to_iarray (column j A)) (to_nat (0::'rows))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. least_non_zero_position_of_vector (vec_to_iarray (column j A)) = least_non_zero_position_of_vector_from_index (vec_to_iarray (column j A)) (mod_type_class.to_nat (0::'rows))
[PROOF STEP]
unfolding least_non_zero_position_of_vector_def to_nat_0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. least_non_zero_position_of_vector_from_index (vec_to_iarray (column j A)) 0 = least_non_zero_position_of_vector_from_index (vec_to_iarray (column j A)) 0
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
least_non_zero_position_of_vector (vec_to_iarray (column j A)) = least_non_zero_position_of_vector_from_index (vec_to_iarray (column j A)) (mod_type_class.to_nat (0::'rows))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
least_non_zero_position_of_vector (vec_to_iarray (column j A)) = least_non_zero_position_of_vector_from_index (vec_to_iarray (column j A)) (mod_type_class.to_nat (0::'rows))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
have "... = to_nat (LEAST n. A $ n $ j \<noteq> 0 \<and> 0 \<le> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. least_non_zero_position_of_vector_from_index (vec_to_iarray (column j A)) (mod_type_class.to_nat (0::'rows)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> (0::'rows) \<le> n)
[PROOF STEP]
proof (rule vec_to_iarray_least_non_zero_position_of_vector_from_index')
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> vector_all_zero_from_index (mod_type_class.to_nat (0::'rows), vec_to_iarray (column j A))
[PROOF STEP]
show "\<not> vector_all_zero_from_index (to_nat (0::'rows), vec_to_iarray (column j A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> vector_all_zero_from_index (mod_type_class.to_nat (0::'rows), vec_to_iarray (column j A))
[PROOF STEP]
unfolding vector_all_zero_from_index_eq[symmetric] column_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<forall>m\<ge>0::'rows. (\<chi>i. A $ i $ j) $ m = (0::'a))
[PROOF STEP]
using Aij least_mod_type[of i]
[PROOF STATE]
proof (prove)
using this:
A $ i $ j = (1::'a)
(0::'rows) \<le> i

goal (1 subgoal):
 1. \<not> (\<forall>m\<ge>0::'rows. (\<chi>i. A $ i $ j) $ m = (0::'a))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<not> vector_all_zero_from_index (mod_type_class.to_nat (0::'rows), vec_to_iarray (column j A))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
least_non_zero_position_of_vector_from_index (vec_to_iarray (column j A)) (mod_type_class.to_nat (0::'rows)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> (0::'rows) \<le> n)

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
least_non_zero_position_of_vector_from_index (vec_to_iarray (column j A)) (mod_type_class.to_nat (0::'rows)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> (0::'rows) \<le> n)

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
have "... = to_nat (LEAST n. A $ n $ j \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> (0::'rows) \<le> n) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
using least_mod_type
[PROOF STATE]
proof (prove)
using this:
(0::?'a) \<le> ?n

goal (1 subgoal):
 1. mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> (0::'rows) \<le> n) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> (0::'rows) \<le> n) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
have least_eq: "least_non_zero_position_of_vector (column_iarray (to_nat j) (matrix_to_iarray A)) = to_nat (LEAST n. A $ n $ j \<noteq> 0)"
[PROOF STATE]
proof (prove)
using this:
least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))

goal (1 subgoal):
 1. least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
have i_eq_least: "i=(LEAST n. A $ n $ j \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
proof (rule Least_equality[symmetric])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A $ i $ j \<noteq> (0::'a)
 2. \<And>y. A $ y $ j \<noteq> (0::'a) \<Longrightarrow> i \<le> y
[PROOF STEP]
show "A $ i $ j \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ i $ j \<noteq> (0::'a)
[PROOF STEP]
by (metis Aij zero_neq_one)
[PROOF STATE]
proof (state)
this:
A $ i $ j \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>y. A $ y $ j \<noteq> (0::'a) \<Longrightarrow> i \<le> y
[PROOF STEP]
show "\<And>y. A $ y $ j \<noteq> 0 \<Longrightarrow> i \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. A $ y $ j \<noteq> (0::'a) \<Longrightarrow> i \<le> y
[PROOF STEP]
by (metis (mono_tags) Aij is_zero_row_def' j order_refl rref rref_condition4 zero_neq_one)
[PROOF STATE]
proof (state)
this:
A $ ?y $ j \<noteq> (0::'a) \<Longrightarrow> i \<le> ?y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i = (LEAST n. A $ n $ j \<noteq> (0::'a))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
have the_eq_least_pos: "(THE i. A $ i $ j = 1) = from_nat (least_non_zero_position_of_vector (column_iarray (to_nat j) (matrix_to_iarray A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (THE i. A $ i $ j = (1::'a)) = mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))
[PROOF STEP]
proof (rule the_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A $ mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))) $ j = (1::'a)
 2. \<And>i. A $ i $ j = (1::'a) \<Longrightarrow> i = mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))
[PROOF STEP]
show " A $ from_nat (least_non_zero_position_of_vector (column_iarray (to_nat j) (matrix_to_iarray A))) $ j = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))) $ j = (1::'a)
[PROOF STEP]
unfolding least_eq from_nat_to_nat_id i_eq_least[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ i $ j = (1::'a)
[PROOF STEP]
using Aij
[PROOF STATE]
proof (prove)
using this:
A $ i $ j = (1::'a)

goal (1 subgoal):
 1. A $ i $ j = (1::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A $ mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))) $ j = (1::'a)

goal (1 subgoal):
 1. \<And>i. A $ i $ j = (1::'a) \<Longrightarrow> i = mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. A $ i $ j = (1::'a) \<Longrightarrow> i = mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))
[PROOF STEP]
assume a: "A $ a $ j = 1"
[PROOF STATE]
proof (state)
this:
A $ a $ j = (1::'a)

goal (1 subgoal):
 1. \<And>i. A $ i $ j = (1::'a) \<Longrightarrow> i = mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))
[PROOF STEP]
show "a = from_nat (least_non_zero_position_of_vector (column_iarray (to_nat j) (matrix_to_iarray A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))
[PROOF STEP]
unfolding least_eq from_nat_to_nat_id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
by (metis Aij a i_eq_least is_zero_row_def' j rref rref_condition4_explicit zero_neq_one)
[PROOF STATE]
proof (state)
this:
a = mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(THE i. A $ i $ j = (1::'a)) = mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
have "to_nat (THE i. A $ i $ j = 1) = to_nat (from_nat (least_non_zero_position_of_vector (column_iarray (to_nat j) (matrix_to_iarray A)))::'rows)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = mod_type_class.to_nat (mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))))
[PROOF STEP]
using the_eq_least_pos
[PROOF STATE]
proof (prove)
using this:
(THE i. A $ i $ j = (1::'a)) = mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = mod_type_class.to_nat (mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = mod_type_class.to_nat (mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = mod_type_class.to_nat (mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
have "... = (least_non_zero_position_of_vector (column_iarray (to_nat j) (matrix_to_iarray A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat (mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
by (rule to_nat_from_nat_id, unfold least_eq, simp add: to_nat_less_card)
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat (mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat (mod_type_class.from_nat (least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)))) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
have "... = to_nat (LEAST n. A $ n $ j \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
unfolding least_eq from_nat_to_nat_id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
have "(THE i. A $ i $ j = 1) = (LEAST n. A $ n $ j \<noteq> 0)"
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))

goal (1 subgoal):
 1. (THE i. A $ i $ j = (1::'a)) = (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
unfolding to_nat_eq
[PROOF STATE]
proof (prove)
using this:
(THE i. A $ i $ j = (1::'a)) = (LEAST n. A $ n $ j \<noteq> (0::'a))

goal (1 subgoal):
 1. (THE i. A $ i $ j = (1::'a)) = (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(THE i. A $ i $ j = (1::'a)) = (LEAST n. A $ n $ j \<noteq> (0::'a))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(THE i. A $ i $ j = (1::'a)) = (LEAST n. A $ n $ j \<noteq> (0::'a))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))
[PROOF STEP]
unfolding least_eq from_nat_to_nat_id
[PROOF STATE]
proof (prove)
using this:
(THE i. A $ i $ j = (1::'a)) = (LEAST n. A $ n $ j \<noteq> (0::'a))

goal (1 subgoal):
 1. mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = mod_type_class.to_nat (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
unfolding to_nat_eq
[PROOF STATE]
proof (prove)
using this:
(THE i. A $ i $ j = (1::'a)) = (LEAST n. A $ n $ j \<noteq> (0::'a))

goal (1 subgoal):
 1. (THE i. A $ i $ j = (1::'a)) = (LEAST n. A $ n $ j \<noteq> (0::'a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat (THE i. A $ i $ j = (1::'a)) = least_non_zero_position_of_vector (column_iarray (mod_type_class.to_nat j) (matrix_to_iarray A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma det_rows_mult: "det (upd_rows M T (\<lambda>i. c i *s a i)) = (\<Prod>i\<in>T. c i) * det (upd_rows M T a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (upd_rows M T (\<lambda>i. c i *s a i)) = prod c T * Square_Matrix.det (upd_rows M T a)
[PROOF STEP]
by transfer (simp add: prod.If_cases sum_distrib_left field_simps prod.distrib)


[STATEMENT]
lemma llcp_ltake [simp]: "llcp (ltake n xs) (ltake m ys) = min (min n m) (llcp xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llcp (ltake n xs) (ltake m ys) = min (min n m) (llcp xs ys)
[PROOF STEP]
by(metis llcp_ltake1 llcp_ltake2 min.assoc)


[STATEMENT]
lemma is_basis_finite: "is_basis V A \<Longrightarrow> is_basis V B \<Longrightarrow> finite A \<longleftrightarrow> finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_basis V A; is_basis V B\<rbrakk> \<Longrightarrow> finite A = finite B
[PROOF STEP]
unfolding is_basis_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> V \<and> local.independent A \<and> V \<subseteq> local.span A \<and> card A = local.dim V; B \<subseteq> V \<and> local.independent B \<and> V \<subseteq> local.span B \<and> card B = local.dim V\<rbrakk> \<Longrightarrow> finite A = finite B
[PROOF STEP]
using independent_span_bound
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?T; local.independent ?S; ?S \<subseteq> local.span ?T\<rbrakk> \<Longrightarrow> finite ?S \<and> card ?S \<le> card ?T

goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> V \<and> local.independent A \<and> V \<subseteq> local.span A \<and> card A = local.dim V; B \<subseteq> V \<and> local.independent B \<and> V \<subseteq> local.span B \<and> card B = local.dim V\<rbrakk> \<Longrightarrow> finite A = finite B
[PROOF STEP]
by auto


[STATEMENT]
lemma of_rat_inverse: "(of_rat (inverse a) :: 'a::field_char_0) = inverse (of_rat a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_rat (inverse a) = inverse (of_rat a)
[PROOF STEP]
by (cases "a = 0") (simp_all add: nonzero_of_rat_inverse)


[STATEMENT]
lemma gcd_proj1_if_dvd_int [simp]: "x dvd y \<Longrightarrow> gcd x y = \<bar>x\<bar>"
  for x y :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x dvd y \<Longrightarrow> gcd x y = \<bar>x\<bar>
[PROOF STEP]
by (metis abs_dvd_iff gcd_0_left_int gcd_unique_int)


[STATEMENT]
lemma isCont_log[continuous_intros, simp]:
  assumes "isCont f a" "isCont g a" "0 < f a" "f a \<noteq> 1" "0 < g a"
  shows "isCont (\<lambda>x. log (f x) (g x)) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. log (f x) (g x)) a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isCont f a
isCont g a
0 < f a
f a \<noteq> 1
0 < g a

goal (1 subgoal):
 1. isCont (\<lambda>x. log (f x) (g x)) a
[PROOF STEP]
unfolding continuous_at
[PROOF STATE]
proof (prove)
using this:
f \<midarrow>a\<rightarrow> f a
g \<midarrow>a\<rightarrow> g a
0 < f a
f a \<noteq> 1
0 < g a

goal (1 subgoal):
 1. (\<lambda>x. log (f x) (g x)) \<midarrow>a\<rightarrow> log (f a) (g a)
[PROOF STEP]
by (rule tendsto_log)


[STATEMENT]
lemma open_map_eq:
     "\<lbrakk>open_map X X' f; \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> open_map X X' g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open_map X X' f; \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> open_map X X' g
[PROOF STEP]
unfolding open_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>U. openin X U \<longrightarrow> openin X' (f ` U); \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> \<forall>U. openin X U \<longrightarrow> openin X' (g ` U)
[PROOF STEP]
by (metis image_cong openin_subset subset_iff)


[STATEMENT]
lemma add_smult_distrib_vec:
  "((a::'a::ring) + b) \<cdot>\<^sub>v v = a \<cdot>\<^sub>v v + b \<cdot>\<^sub>v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b) \<cdot>\<^sub>v v = a \<cdot>\<^sub>v v + b \<cdot>\<^sub>v v
[PROOF STEP]
unfolding smult_vec_def plus_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (dim_vec v) (\<lambda>i. (a + b) * v $ i) = vec (dim_vec (vec (dim_vec v) (\<lambda>i. b * v $ i))) (\<lambda>i. vec (dim_vec v) (\<lambda>i. a * v $ i) $ i + vec (dim_vec v) (\<lambda>i. b * v $ i) $ i)
[PROOF STEP]
by (rule eq_vecI, auto simp: distrib_right)


[STATEMENT]
lemma continuous_constant_on_closure:
  fixes f :: "_ \<Rightarrow> 'b::t1_space"
  assumes "continuous_on (closure S) f"
      and "\<And>x. x \<in> S \<Longrightarrow> f x = a"
      and "x \<in> closure S"
  shows "f x = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x = a
[PROOF STEP]
using continuous_closed_preimage_constant[of "closure S" f a]
      assms closure_minimal[of S "{x \<in> closure S. f x = a}"] closure_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_on (closure S) f; closed (closure S)\<rbrakk> \<Longrightarrow> closed {x \<in> closure S. f x = a}
continuous_on (closure S) f
?x \<in> S \<Longrightarrow> f ?x = a
x \<in> closure S
\<lbrakk>S \<subseteq> {x \<in> closure S. f x = a}; closed {x \<in> closure S. f x = a}\<rbrakk> \<Longrightarrow> closure S \<subseteq> {x \<in> closure S. f x = a}
?S \<subseteq> closure ?S

goal (1 subgoal):
 1. f x = a
[PROOF STEP]
unfolding subset_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_on (closure S) f; closed (closure S)\<rbrakk> \<Longrightarrow> closed {x \<in> closure S. f x = a}
continuous_on (closure S) f
?x \<in> S \<Longrightarrow> f ?x = a
x \<in> closure S
\<lbrakk>\<forall>x\<in>S. x \<in> {x \<in> closure S. f x = a}; closed {x \<in> closure S. f x = a}\<rbrakk> \<Longrightarrow> \<forall>x\<in>closure S. x \<in> {x \<in> closure S. f x = a}
\<forall>x\<in>?S. x \<in> closure ?S

goal (1 subgoal):
 1. f x = a
[PROOF STEP]
by auto


[STATEMENT]
lemma mem_samp_primes_excl_gt_2:
  shows "x \<in> set_spmf (sample_set_excl prime_set {y}) \<Longrightarrow> x > 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set_spmf (sample_set_excl prime_set {y}) \<Longrightarrow> 2 < x
[PROOF STEP]
apply(simp add: finite_prime_set sample_set_excl_def  prime_set_ass )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> prime_set \<and> x \<noteq> y \<Longrightarrow> 2 < x
[PROOF STEP]
using prime_set_ass
[PROOF STATE]
proof (prove)
using this:
prime_set \<subseteq> {x. prime x \<and> 2 < x}

goal (1 subgoal):
 1. x \<in> prime_set \<and> x \<noteq> y \<Longrightarrow> 2 < x
[PROOF STEP]
by blast


[STATEMENT]
lemma real_root_lt_1_iff [simp]: "0 < n \<Longrightarrow> root n x < 1 \<longleftrightarrow> x < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (root n x < 1) = (x < 1)
[PROOF STEP]
using real_root_less_iff [where y=1]
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> (root ?n ?x < root ?n 1) = (?x < 1)

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (root n x < 1) = (x < 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma inverse:
  assumes "gcd x (q::nat) = 1"
    and "q > 0"
  shows "[x * (fst (bezw x q)) = 1] (mod q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [int x * fst (bezw x q) = 1] (mod int q)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. [int x * fst (bezw x q) = 1] (mod int q)
[PROOF STEP]
have int_eq: "fst (bezw  x q) * x + snd (bezw x q) * int q = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (bezw x q) * int x + snd (bezw x q) * int q = 1
[PROOF STEP]
by (metis assms(1) bezw_aux of_nat_1)
[PROOF STATE]
proof (state)
this:
fst (bezw x q) * int x + snd (bezw x q) * int q = 1

goal (1 subgoal):
 1. [int x * fst (bezw x q) = 1] (mod int q)
[PROOF STEP]
hence int_eq': "(fst (bezw  x q) * x + snd (bezw x q) * int q) mod q = 1 mod q"
[PROOF STATE]
proof (prove)
using this:
fst (bezw x q) * int x + snd (bezw x q) * int q = 1

goal (1 subgoal):
 1. (fst (bezw x q) * int x + snd (bezw x q) * int q) mod int q = int (1 mod q)
[PROOF STEP]
by (metis of_nat_1 zmod_int)
[PROOF STATE]
proof (state)
this:
(fst (bezw x q) * int x + snd (bezw x q) * int q) mod int q = int (1 mod q)

goal (1 subgoal):
 1. [int x * fst (bezw x q) = 1] (mod int q)
[PROOF STEP]
hence "(fst (bezw x q) * x) mod q = 1 mod q"
[PROOF STATE]
proof (prove)
using this:
(fst (bezw x q) * int x + snd (bezw x q) * int q) mod int q = int (1 mod q)

goal (1 subgoal):
 1. fst (bezw x q) * int x mod int q = int (1 mod q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fst (bezw x q) * int x mod int q = int (1 mod q)

goal (1 subgoal):
 1. [int x * fst (bezw x q) = 1] (mod int q)
[PROOF STEP]
hence "[(fst (bezw x q)) * x  = 1] (mod q)"
[PROOF STATE]
proof (prove)
using this:
fst (bezw x q) * int x mod int q = int (1 mod q)

goal (1 subgoal):
 1. [fst (bezw x q) * int x = 1] (mod int q)
[PROOF STEP]
using cong_def int_eq int_eq'
[PROOF STATE]
proof (prove)
using this:
fst (bezw x q) * int x mod int q = int (1 mod q)
[?b = ?c] (mod ?a) = (?b mod ?a = ?c mod ?a)
fst (bezw x q) * int x + snd (bezw x q) * int q = 1
(fst (bezw x q) * int x + snd (bezw x q) * int q) mod int q = int (1 mod q)

goal (1 subgoal):
 1. [fst (bezw x q) * int x = 1] (mod int q)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
[fst (bezw x q) * int x = 1] (mod int q)

goal (1 subgoal):
 1. [int x * fst (bezw x q) = 1] (mod int q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[fst (bezw x q) * int x = 1] (mod int q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
[fst (bezw x q) * int x = 1] (mod int q)

goal (1 subgoal):
 1. [int x * fst (bezw x q) = 1] (mod int q)
[PROOF STEP]
by(simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
[int x * fst (bezw x q) = 1] (mod int q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Img_carrier:"\<lbrakk>Group F; Group G; f \<in> gHom F G \<rbrakk> \<Longrightarrow>
                         carrier (Img\<^bsub>F,G\<^esub> f) = f ` (carrier F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> carrier (Img\<^bsub>F,G\<^esub> f) = f ` carrier F
[PROOF STEP]
by (simp add:Gimage_def Gp_def)


[STATEMENT]
lemma norm_is_Proj: \<open>norm P \<le> 1\<close> if \<open>is_Proj P\<close> for P :: \<open>'a :: chilbert_space \<Rightarrow>\<^sub>C\<^sub>L 'a\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm P \<le> 1
[PROOF STEP]
by (metis Proj_on_own_range norm_Proj_leq1 that)


[STATEMENT]
lemma wordinterval_Union:
    "wordinterval_to_set (wordinterval_Union ws) = (\<Union> w \<in> (set ws). wordinterval_to_set w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_to_set (wordinterval_Union ws) = \<Union> (wordinterval_to_set ` set ws)
[PROOF STEP]
by(induction ws) (simp_all add: wordinterval_compress wordinterval_Union_def)


[STATEMENT]
lemma lookup_mult:
  "lookup (f * g) k = (\<Sum>l. lookup f l * (\<Sum>q. lookup g q when k = l + q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (f * g) k = (\<Sum>l. lookup f l * (\<Sum>q. lookup g q when k = l + q))
[PROOF STEP]
by transfer (simp add: prod_fun_def)


[STATEMENT]
lemma div2_in_bounds:
  "\<lbrakk> braun (Node l x r); n \<in> {1..size(Node l x r)}; n > 1 \<rbrakk> \<Longrightarrow>
   (odd n \<longrightarrow> n div 2 \<in> {1..size r}) \<and> (even n \<longrightarrow> n div 2 \<in> {1..size l})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>braun \<langle>l, x, r\<rangle>; n \<in> {1..size \<langle>l, x, r\<rangle>}; 1 < n\<rbrakk> \<Longrightarrow> (odd n \<longrightarrow> n div 2 \<in> {1..size r}) \<and> (even n \<longrightarrow> n div 2 \<in> {1..size l})
[PROOF STEP]
by auto arith


[STATEMENT]
lemma (in Ring) bilinear_mem:"\<lbrakk>R module M1; R module M2; R module N;
      m1 \<in> carrier M1; m2 \<in> carrier M2; bilinear_map f R M1 M2 N\<rbrakk> \<Longrightarrow>
      f (m1, m2) \<in> carrier N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M1; R module M2; R module N; m1 \<in> carrier M1; m2 \<in> carrier M2; bilinear_map f R M1 M2 N\<rbrakk> \<Longrightarrow> f (m1, m2) \<in> carrier N
[PROOF STEP]
apply (simp add:bilinear_map_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M1; R module M2; R module N; m1 \<in> carrier M1; m2 \<in> carrier M2; f \<in> M1 \<times>\<^sub>c M2 \<rightarrow> carrier N \<and> f \<in> extensional (M1 \<times>\<^sub>c M2) \<and> (\<forall>x1\<in>carrier M1. \<forall>x2\<in>carrier M1. \<forall>y\<in>carrier M2. f (x1 \<plusminus>\<^bsub>M1\<^esub> x2, y) = f (x1, y) \<plusminus>\<^bsub>N\<^esub> f (x2, y)) \<and> (\<forall>x\<in>carrier M1. \<forall>y1\<in>carrier M2. \<forall>y2\<in>carrier M2. f (x, y1 \<plusminus>\<^bsub>M2\<^esub> y2) = f (x, y1) \<plusminus>\<^bsub>N\<^esub> f (x, y2)) \<and> (\<forall>x\<in>carrier M1. \<forall>y\<in>carrier M2. \<forall>r\<in>carrier R. f (r \<cdot>\<^sub>s\<^bsub>M1\<^esub> x, y) = r \<cdot>\<^sub>s\<^bsub>N\<^esub> f (x, y) \<and> f (x, r \<cdot>\<^sub>s\<^bsub>M2\<^esub> y) = r \<cdot>\<^sub>s\<^bsub>N\<^esub> f (x, y))\<rbrakk> \<Longrightarrow> f (m1, m2) \<in> carrier N
[PROOF STEP]
apply (erule conjE)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M1; R module M2; R module N; m1 \<in> carrier M1; m2 \<in> carrier M2; f \<in> M1 \<times>\<^sub>c M2 \<rightarrow> carrier N; f \<in> extensional (M1 \<times>\<^sub>c M2); \<forall>x1\<in>carrier M1. \<forall>x2\<in>carrier M1. \<forall>y\<in>carrier M2. f (x1 \<plusminus>\<^bsub>M1\<^esub> x2, y) = f (x1, y) \<plusminus>\<^bsub>N\<^esub> f (x2, y); \<forall>x\<in>carrier M1. \<forall>y1\<in>carrier M2. \<forall>y2\<in>carrier M2. f (x, y1 \<plusminus>\<^bsub>M2\<^esub> y2) = f (x, y1) \<plusminus>\<^bsub>N\<^esub> f (x, y2); \<forall>x\<in>carrier M1. \<forall>y\<in>carrier M2. \<forall>r\<in>carrier R. f (r \<cdot>\<^sub>s\<^bsub>M1\<^esub> x, y) = r \<cdot>\<^sub>s\<^bsub>N\<^esub> f (x, y) \<and> f (x, r \<cdot>\<^sub>s\<^bsub>M2\<^esub> y) = r \<cdot>\<^sub>s\<^bsub>N\<^esub> f (x, y)\<rbrakk> \<Longrightarrow> f (m1, m2) \<in> carrier N
[PROOF STEP]
apply (rule funcset_mem [of "f" "M1 \<times>\<^sub>c M2" "carrier N"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M1; R module M2; R module N; m1 \<in> carrier M1; m2 \<in> carrier M2; f \<in> M1 \<times>\<^sub>c M2 \<rightarrow> carrier N; f \<in> extensional (M1 \<times>\<^sub>c M2); \<forall>x1\<in>carrier M1. \<forall>x2\<in>carrier M1. \<forall>y\<in>carrier M2. f (x1 \<plusminus>\<^bsub>M1\<^esub> x2, y) = f (x1, y) \<plusminus>\<^bsub>N\<^esub> f (x2, y); \<forall>x\<in>carrier M1. \<forall>y1\<in>carrier M2. \<forall>y2\<in>carrier M2. f (x, y1 \<plusminus>\<^bsub>M2\<^esub> y2) = f (x, y1) \<plusminus>\<^bsub>N\<^esub> f (x, y2); \<forall>x\<in>carrier M1. \<forall>y\<in>carrier M2. \<forall>r\<in>carrier R. f (r \<cdot>\<^sub>s\<^bsub>M1\<^esub> x, y) = r \<cdot>\<^sub>s\<^bsub>N\<^esub> f (x, y) \<and> f (x, r \<cdot>\<^sub>s\<^bsub>M2\<^esub> y) = r \<cdot>\<^sub>s\<^bsub>N\<^esub> f (x, y)\<rbrakk> \<Longrightarrow> (m1, m2) \<in> M1 \<times>\<^sub>c M2
[PROOF STEP]
apply (simp add:prod_carr_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma LIMSEQ_inverse_realpow_zero: "1 < x \<Longrightarrow> (\<lambda>n. inverse (x ^ n)) \<longlonglongrightarrow> 0"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (\<lambda>n. inverse (x ^ n)) \<longlonglongrightarrow> 0
[PROOF STEP]
by (rule filterlim_compose[OF tendsto_inverse_0 filterlim_realpow_sequentially_gt1]) simp


[STATEMENT]
lemma nth_prime_le_iff [simp]: "nth_prime m \<le> nth_prime n \<longleftrightarrow> m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nth_prime m \<le> nth_prime n) = (m \<le> n)
[PROOF STEP]
using strict_mono_less_eq[OF strict_mono_nth_prime]
[PROOF STATE]
proof (prove)
using this:
(nth_prime ?x \<le> nth_prime ?y) = (?x \<le> ?y)

goal (1 subgoal):
 1. (nth_prime m \<le> nth_prime n) = (m \<le> n)
[PROOF STEP]
by blast


[STATEMENT]
lemma some_inv_into:
  assumes "s < t"
  shows "(SOME p. p\<in>cube 1 t \<and> p 0 = s) = (the_inv_into (cube 1 t) (\<lambda>f. f 0) s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME p. p \<in> cube 1 t \<and> p 0 = s) = the_inv_into (cube 1 t) (\<lambda>f. f 0) s
[PROOF STEP]
using inv_into_cube_props[of s t] one_dim_cube_eq_nat_set[of t] assms
[PROOF STATE]
proof (prove)
using this:
s < t \<Longrightarrow> the_inv_into (cube 1 t) (\<lambda>f. f 0) s \<in> cube 1 t
s < t \<Longrightarrow> the_inv_into (cube 1 t) (\<lambda>f. f 0) s 0 = s
bij_betw (\<lambda>f. f 0) (cube 1 t) {..<t}
s < t

goal (1 subgoal):
 1. (SOME p. p \<in> cube 1 t \<and> p 0 = s) = the_inv_into (cube 1 t) (\<lambda>f. f 0) s
[PROOF STEP]
unfolding bij_betw_def inj_on_def
[PROOF STATE]
proof (prove)
using this:
s < t \<Longrightarrow> the_inv_into (cube 1 t) (\<lambda>f. f 0) s \<in> cube 1 t
s < t \<Longrightarrow> the_inv_into (cube 1 t) (\<lambda>f. f 0) s 0 = s
(\<forall>x\<in>cube 1 t. \<forall>y\<in>cube 1 t. x 0 = y 0 \<longrightarrow> x = y) \<and> (\<lambda>f. f 0) ` cube 1 t = {..<t}
s < t

goal (1 subgoal):
 1. (SOME p. p \<in> cube 1 t \<and> p 0 = s) = the_inv_into (cube 1 t) (\<lambda>f. f 0) s
[PROOF STEP]
by auto


[STATEMENT]
lemma homeomorphic_minimal:
  "s homeomorphic t \<longleftrightarrow>
    (\<exists>f g. (\<forall>x\<in>s. f(x) \<in> t \<and> (g(f(x)) = x)) \<and>
           (\<forall>y\<in>t. g(y) \<in> s \<and> (f(g(y)) = y)) \<and>
           continuous_on s f \<and> continuous_on t g)"
   (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s homeomorphic t = (\<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. s homeomorphic t \<Longrightarrow> \<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g
 2. \<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g \<Longrightarrow> s homeomorphic t
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
s homeomorphic t

goal (2 subgoals):
 1. s homeomorphic t \<Longrightarrow> \<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g
 2. \<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g \<Longrightarrow> s homeomorphic t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s homeomorphic t
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
s homeomorphic t

goal (1 subgoal):
 1. \<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g
[PROOF STEP]
by (fastforce simp: homeomorphic_def homeomorphism_def)
[PROOF STATE]
proof (state)
this:
\<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g

goal (1 subgoal):
 1. \<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g \<Longrightarrow> s homeomorphic t
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g \<Longrightarrow> s homeomorphic t
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g

goal (1 subgoal):
 1. \<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g \<Longrightarrow> s homeomorphic t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<exists>f g. (\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x) \<and> (\<forall>y\<in>t. g y \<in> s \<and> f (g y) = y) \<and> continuous_on s f \<and> continuous_on t g

goal (1 subgoal):
 1. s homeomorphic t
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f g. \<lbrakk>\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x; \<forall>y\<in>t. g y \<in> s \<and> f (g y) = y; continuous_on s f; continuous_on t g\<rbrakk> \<Longrightarrow> s homeomorphic t
[PROOF STEP]
unfolding homeomorphic_def homeomorphism_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f g. \<lbrakk>\<forall>x\<in>s. f x \<in> t \<and> g (f x) = x; \<forall>y\<in>t. g y \<in> s \<and> f (g y) = y; continuous_on s f; continuous_on t g\<rbrakk> \<Longrightarrow> \<exists>f g. (\<forall>x\<in>s. g (f x) = x) \<and> f ` s = t \<and> continuous_on s f \<and> (\<forall>y\<in>t. f (g y) = y) \<and> g ` t = s \<and> continuous_on t g
[PROOF STEP]
by (metis equalityI image_subset_iff subsetI)
[PROOF STATE]
proof (state)
this:
s homeomorphic t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma desargues_config_3D_coplanar_4_bis :
  assumes "desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma>"
  shows "rk {A, B, C, \<beta>} = 3" and "rk {A', B', C', \<beta>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<beta>} = 3 &&& rk {A', B', C', \<beta>} = 3
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rk {A, B, C, \<beta>} = 3
 2. rk {A', B', C', \<beta>} = 3
[PROOF STEP]
show "rk {A, B, C, \<beta>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<beta>} = 3
[PROOF STEP]
using assms desargues_config_3D_def[of A B C A' B' C' P \<alpha> \<beta> \<gamma>] coplanar_4_bis
[PROOF STATE]
proof (prove)
using this:
desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma>
desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma> \<equiv> rk {A, B, C} = 3 \<and> rk {A', B', C'} = 3 \<and> rk {A, A', P} = 2 \<and> rk {B, B', P} = 2 \<and> rk {C, C', P} = 2 \<and> 4 \<le> rk {A, B, C, A', B', C'} \<and> rk {B, C, \<alpha>} = 2 \<and> rk {B', C', \<alpha>} = 2 \<and> rk {A, C, \<beta>} = 2 \<and> rk {A', C', \<beta>} = 2 \<and> rk {A, B, \<gamma>} = 2 \<and> rk {A', B', \<gamma>} = 2
\<lbrakk>rk {?A, ?B, ?C} = 3; rk {?A, ?C, ?\<beta>} = 2\<rbrakk> \<Longrightarrow> rk {?A, ?B, ?C, ?\<beta>} = 3

goal (1 subgoal):
 1. rk {A, B, C, \<beta>} = 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<beta>} = 3

goal (1 subgoal):
 1. rk {A', B', C', \<beta>} = 3
[PROOF STEP]
show "rk {A', B', C', \<beta>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A', B', C', \<beta>} = 3
[PROOF STEP]
using assms desargues_config_3D_def[of A B C A' B' C' P \<alpha> \<beta> \<gamma>] coplanar_4_bis
[PROOF STATE]
proof (prove)
using this:
desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma>
desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma> \<equiv> rk {A, B, C} = 3 \<and> rk {A', B', C'} = 3 \<and> rk {A, A', P} = 2 \<and> rk {B, B', P} = 2 \<and> rk {C, C', P} = 2 \<and> 4 \<le> rk {A, B, C, A', B', C'} \<and> rk {B, C, \<alpha>} = 2 \<and> rk {B', C', \<alpha>} = 2 \<and> rk {A, C, \<beta>} = 2 \<and> rk {A', C', \<beta>} = 2 \<and> rk {A, B, \<gamma>} = 2 \<and> rk {A', B', \<gamma>} = 2
\<lbrakk>rk {?A, ?B, ?C} = 3; rk {?A, ?C, ?\<beta>} = 2\<rbrakk> \<Longrightarrow> rk {?A, ?B, ?C, ?\<beta>} = 3

goal (1 subgoal):
 1. rk {A', B', C', \<beta>} = 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rk {A', B', C', \<beta>} = 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem E4: "\<turnstile> \<box>F \<longrightarrow> \<diamond>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>F \<longrightarrow> \<diamond>F
[PROOF STEP]
by (rule lift_imp_trans[OF ax1 E3])


[STATEMENT]
lemma of_rat_inverse: "(of_rat (inverse a) :: 'a::field_char_0) = inverse (of_rat a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_rat (inverse a) = inverse (of_rat a)
[PROOF STEP]
by (cases "a = 0") (simp_all add: nonzero_of_rat_inverse)


[STATEMENT]
lemma higher_pderiv_add: "(pderiv ^^ n) (p + q) = (pderiv ^^ n) p + (pderiv ^^ n) q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pderiv ^^ n) (p + q) = (pderiv ^^ n) p + (pderiv ^^ n) q
[PROOF STEP]
by (induction n arbitrary: p q) (simp_all del: funpow.simps add: funpow_Suc_right pderiv_add)


[STATEMENT]
lemma f_plus_minus: "((f x)::real) = pp f x - np f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x = pp f x - np f x
[PROOF STEP]
by (simp add:positive_part_def negative_part_def)


[STATEMENT]
lemma continuous_openin_preimage:
  "\<lbrakk>continuous_on S f; f ` S \<subseteq> T; openin (top_of_set T) U\<rbrakk>
        \<Longrightarrow> openin (top_of_set S) (S \<inter> f -` U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on S f; f ` S \<subseteq> T; openin (top_of_set T) U\<rbrakk> \<Longrightarrow> openin (top_of_set S) (S \<inter> f -` U)
[PROOF STEP]
by (simp add: continuous_on_open_gen)


[STATEMENT]
lemma iAll_subset: "\<lbrakk> A \<subseteq> B; \<box> t B. P t \<rbrakk> \<Longrightarrow> \<box> t A. P t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; \<box> t B. P t\<rbrakk> \<Longrightarrow> \<box> t A. P t
[PROOF STEP]
by (rule iall_subset_imp_iall)


[STATEMENT]
lemma numeral_le_floor [simp]: "numeral v \<le> \<lfloor>x\<rfloor> \<longleftrightarrow> numeral v \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral v \<le> \<lfloor>x\<rfloor>) = (numeral v \<le> x)
[PROOF STEP]
by (simp add: le_floor_iff)


[STATEMENT]
lemma VLambda_mono:
  assumes "A \<subseteq>\<^sub>\<circ> B"
  shows "(\<lambda>a\<in>\<^sub>\<circ>A. f a) \<subseteq>\<^sub>\<circ> (\<lambda>a\<in>\<^sub>\<circ>B. f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VLambda A f \<subseteq>\<^sub>\<circ> VLambda B f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq>\<^sub>\<circ> B

goal (1 subgoal):
 1. VLambda A f \<subseteq>\<^sub>\<circ> VLambda B f
[PROOF STEP]
by auto


[STATEMENT]
lemma H_Inf_pres_fstar:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  shows "Inf_pres f \<Longrightarrow> x \<le> f x \<Longrightarrow> x \<le> fstar f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Inf_pres f; x \<le> f x\<rbrakk> \<Longrightarrow> x \<le> fstar f x
[PROOF STEP]
by (simp add: H_Inf_pres_fpower fstar_def le_INF_iff)


[STATEMENT]
lemma ds_trans_contrapos: assumes t: "trans r" and "x \<notin> ds r S" and "(x,y) \<in> r" shows "y \<notin> ds r S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<notin> r \<down>s S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
trans r
x \<notin> r \<down>s S
(x, y) \<in> r

goal (1 subgoal):
 1. y \<notin> r \<down>s S
[PROOF STEP]
unfolding ds_def trans_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y z. (x, y) \<in> r \<longrightarrow> (y, z) \<in> r \<longrightarrow> (x, z) \<in> r
x \<notin> {y. \<exists>x\<in>S. (y, x) \<in> r}
(x, y) \<in> r

goal (1 subgoal):
 1. y \<notin> {y. \<exists>x\<in>S. (y, x) \<in> r}
[PROOF STEP]
by fast


[STATEMENT]
lemma evalF_FNot: "!!phi. evalF M phi (FNot A) = (\<not> evalF M phi A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>phi. evalF M phi (FNot A) = (\<not> evalF M phi A)
[PROOF STEP]
by(induct A rule: formula_signs_induct) simp_all


[STATEMENT]
lemma beukers_integral3_conv_nn_integral:
  "beukers_integral3 = enn2real beukers_nn_integral3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.beukers_integral3 = enn2real local.beukers_nn_integral3
[PROOF STEP]
unfolding beukers_integral3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT (w, x, y):D'. (x * (1 - x) * y * (1 - y) * w * (1 - w)) ^ n / (1 - (1 - x * y) * w) ^ (n + 1) = enn2real local.beukers_nn_integral3
[PROOF STEP]
using beukers_nn_integral3_finite less_imp_le[OF beukers_denom_ineq]
[PROOF STATE]
proof (prove)
using this:
local.beukers_nn_integral3 < \<infinity>
\<lbrakk>?x1 \<in> {0<..<1}; ?y1 \<in> {0<..<1}; ?z1 \<in> {0..1}\<rbrakk> \<Longrightarrow> (1 - ?x1 * ?y1) * ?z1 \<le> 1

goal (1 subgoal):
 1. LBINT (w, x, y):D'. (x * (1 - x) * y * (1 - y) * w * (1 - w)) ^ n / (1 - (1 - x * y) * w) ^ (n + 1) = enn2real local.beukers_nn_integral3
[PROOF STEP]
by (intro set_integral_eq_nn_integral AE_I2 impI)
     (auto simp: D'_def set_borel_measurable_def beukers_nn_integral3_def case_prod_unfold
           simp flip: lborel_prod)


[STATEMENT]
lemma gcd_add_dvd_right1: "a dvd b \<Longrightarrow> gcd a (b + c) = gcd a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd b \<Longrightarrow> gcd a (b + c) = gcd a c
[PROOF STEP]
by (elim dvdE) (simp add: gcd_add_mult mult.commute[of a])


[STATEMENT]
theorem so_star_stop_leq_se_stop:
  assumes "\<delta> \<le> other.t_stop"
  assumes "other.s' \<delta> < v\<^sub>e"
  assumes "\<not> (a\<^sub>o > a\<^sub>e \<and> other.s' \<delta> < v\<^sub>e \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> < 0)"
  shows "0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
consider "v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<ge> 0" | "\<not> (v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<ge> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> thesis; \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> ?thesis; \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> ?thesis; \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
 2. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta>

goal (2 subgoals):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
 2. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
hence "v\<^sub>e - a\<^sub>e / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta>

goal (1 subgoal):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>)
[PROOF STEP]
unfolding other.s'_def other.p'_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * (if \<delta> \<le> other.t_stop then v\<^sub>o + a\<^sub>o * \<delta> else 0)

goal (1 subgoal):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>)
[PROOF STEP]
by (auto simp add:assms(1))
[PROOF STATE]
proof (state)
this:
0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>)

goal (2 subgoals):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
 2. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
hence "v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta> \<ge> 0" (is "?l0 \<ge> 0")
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>)

goal (1 subgoal):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta>
[PROOF STEP]
using decelerate_other
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>)
a\<^sub>o < 0

goal (1 subgoal):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta>
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta>

goal (2 subgoals):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
 2. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
hence "?l0 / a\<^sub>e \<le> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta>

goal (1 subgoal):
 1. (v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta>) / a\<^sub>e \<le> 0
[PROOF STEP]
using divide_right_mono_neg[OF \<open>?l0 \<ge> 0\<close>] decelerate_ego
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta>
?c \<le> 0 \<Longrightarrow> (v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta>) / ?c \<le> 0 / ?c
a\<^sub>e < 0

goal (1 subgoal):
 1. (v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta>) / a\<^sub>e \<le> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta>) / a\<^sub>e \<le> 0

goal (2 subgoals):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
 2. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
hence "0 \<ge> v\<^sub>e / a\<^sub>e - v\<^sub>o / a\<^sub>o - \<delta>"
[PROOF STATE]
proof (prove)
using this:
(v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta>) / a\<^sub>e \<le> 0

goal (1 subgoal):
 1. v\<^sub>e / a\<^sub>e - v\<^sub>o / a\<^sub>o - \<delta> \<le> 0
[PROOF STEP]
using decelerate_ego
[PROOF STATE]
proof (prove)
using this:
(v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o - a\<^sub>e * \<delta>) / a\<^sub>e \<le> 0
a\<^sub>e < 0

goal (1 subgoal):
 1. v\<^sub>e / a\<^sub>e - v\<^sub>o / a\<^sub>o - \<delta> \<le> 0
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
v\<^sub>e / a\<^sub>e - v\<^sub>o / a\<^sub>o - \<delta> \<le> 0

goal (2 subgoals):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
 2. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
hence *: "- v\<^sub>e / a\<^sub>e \<ge> - (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o"
[PROOF STATE]
proof (prove)
using this:
v\<^sub>e / a\<^sub>e - v\<^sub>o / a\<^sub>o - \<delta> \<le> 0

goal (1 subgoal):
 1. - (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o \<le> - v\<^sub>e / a\<^sub>e
[PROOF STEP]
using decelerate_other
[PROOF STATE]
proof (prove)
using this:
v\<^sub>e / a\<^sub>e - v\<^sub>o / a\<^sub>o - \<delta> \<le> 0
a\<^sub>o < 0

goal (1 subgoal):
 1. - (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o \<le> - v\<^sub>e / a\<^sub>e
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
- (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o \<le> - v\<^sub>e / a\<^sub>e

goal (2 subgoals):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
 2. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<delta> \<le> other.t_stop
other.s' \<delta> < v\<^sub>e
\<not> (a\<^sub>e < a\<^sub>o \<and> other.s' \<delta> < v\<^sub>e \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> < 0)
[PROOF STEP]
have **: "v\<^sub>o + a\<^sub>o * \<delta> \<le> v\<^sub>e"
[PROOF STATE]
proof (prove)
using this:
\<delta> \<le> other.t_stop
other.s' \<delta> < v\<^sub>e
\<not> (a\<^sub>e < a\<^sub>o \<and> other.s' \<delta> < v\<^sub>e \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> < 0)

goal (1 subgoal):
 1. v\<^sub>o + a\<^sub>o * \<delta> \<le> v\<^sub>e
[PROOF STEP]
unfolding other.s'_def other.p'_def
[PROOF STATE]
proof (prove)
using this:
\<delta> \<le> other.t_stop
(if \<delta> \<le> other.t_stop then v\<^sub>o + a\<^sub>o * \<delta> else 0) < v\<^sub>e
\<not> (a\<^sub>e < a\<^sub>o \<and> (if \<delta> \<le> other.t_stop then v\<^sub>o + a\<^sub>o * \<delta> else 0) < v\<^sub>e \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * (if \<delta> \<le> other.t_stop then v\<^sub>o + a\<^sub>o * \<delta> else 0) < 0)

goal (1 subgoal):
 1. v\<^sub>o + a\<^sub>o * \<delta> \<le> v\<^sub>e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v\<^sub>o + a\<^sub>o * \<delta> \<le> v\<^sub>e

goal (2 subgoals):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
 2. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
have vo_star_nneg: "v\<^sub>o + a\<^sub>o * \<delta> \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> v\<^sub>o + a\<^sub>o * \<delta>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> v\<^sub>o + a\<^sub>o * \<delta>
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
\<delta> \<le> other.t_stop
[PROOF STEP]
have "- v\<^sub>o \<le> a\<^sub>o * \<delta>"
[PROOF STATE]
proof (prove)
using this:
\<delta> \<le> other.t_stop

goal (1 subgoal):
 1. - v\<^sub>o \<le> a\<^sub>o * \<delta>
[PROOF STEP]
unfolding other.t_stop_def
[PROOF STATE]
proof (prove)
using this:
\<delta> \<le> - v\<^sub>o / a\<^sub>o

goal (1 subgoal):
 1. - v\<^sub>o \<le> a\<^sub>o * \<delta>
[PROOF STEP]
using decelerate_other
[PROOF STATE]
proof (prove)
using this:
\<delta> \<le> - v\<^sub>o / a\<^sub>o
a\<^sub>o < 0

goal (1 subgoal):
 1. - v\<^sub>o \<le> a\<^sub>o * \<delta>
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
- v\<^sub>o \<le> a\<^sub>o * \<delta>

goal (1 subgoal):
 1. 0 \<le> v\<^sub>o + a\<^sub>o * \<delta>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
- v\<^sub>o \<le> a\<^sub>o * \<delta>

goal (1 subgoal):
 1. 0 \<le> v\<^sub>o + a\<^sub>o * \<delta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> v\<^sub>o + a\<^sub>o * \<delta>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> v\<^sub>o + a\<^sub>o * \<delta>

goal (2 subgoals):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
 2. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
from mult_mono[OF * ** _ \<open>0 \<le> v\<^sub>o + a\<^sub>o * \<delta>\<close>]
[PROOF STATE]
proof (chain)
picking this:
0 \<le> - v\<^sub>e / a\<^sub>e \<Longrightarrow> - (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>) \<le> - v\<^sub>e / a\<^sub>e * v\<^sub>e
[PROOF STEP]
have "- (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>) \<le> - v\<^sub>e / a\<^sub>e * v\<^sub>e"
[PROOF STATE]
proof (prove)
using this:
0 \<le> - v\<^sub>e / a\<^sub>e \<Longrightarrow> - (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>) \<le> - v\<^sub>e / a\<^sub>e * v\<^sub>e

goal (1 subgoal):
 1. - (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>) \<le> - v\<^sub>e / a\<^sub>e * v\<^sub>e
[PROOF STEP]
using nonneg_vel_ego decelerate_ego
[PROOF STATE]
proof (prove)
using this:
0 \<le> - v\<^sub>e / a\<^sub>e \<Longrightarrow> - (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>) \<le> - v\<^sub>e / a\<^sub>e * v\<^sub>e
0 \<le> v\<^sub>e
a\<^sub>e < 0

goal (1 subgoal):
 1. - (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>) \<le> - v\<^sub>e / a\<^sub>e * v\<^sub>e
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
- (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>) \<le> - v\<^sub>e / a\<^sub>e * v\<^sub>e

goal (2 subgoals):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
 2. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
hence "- (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e "
[PROOF STATE]
proof (prove)
using this:
- (v\<^sub>o + a\<^sub>o * \<delta>) / a\<^sub>o * (v\<^sub>o + a\<^sub>o * \<delta>) \<le> - v\<^sub>e / a\<^sub>e * v\<^sub>e

goal (1 subgoal):
 1. - (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e
[PROOF STEP]
by (auto simp add: field_simps power_def)
[PROOF STATE]
proof (state)
this:
- (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e

goal (2 subgoals):
 1. 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
 2. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
- (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e

goal (1 subgoal):
 1. 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2

goal (1 subgoal):
 1. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta>

goal (1 subgoal):
 1. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<delta> \<le> other.t_stop
other.s' \<delta> < v\<^sub>e
\<not> (a\<^sub>e < a\<^sub>o \<and> other.s' \<delta> < v\<^sub>e \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> < 0)
\<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta>
[PROOF STEP]
have "a\<^sub>o \<le> a\<^sub>e"
[PROOF STATE]
proof (prove)
using this:
\<delta> \<le> other.t_stop
other.s' \<delta> < v\<^sub>e
\<not> (a\<^sub>e < a\<^sub>o \<and> other.s' \<delta> < v\<^sub>e \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> < 0)
\<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta>

goal (1 subgoal):
 1. a\<^sub>o \<le> a\<^sub>e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a\<^sub>o \<le> a\<^sub>e

goal (1 subgoal):
 1. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
other.s' \<delta> < v\<^sub>e
[PROOF STEP]
have "(v\<^sub>o + a\<^sub>o * \<delta>) \<le> v\<^sub>e"
[PROOF STATE]
proof (prove)
using this:
other.s' \<delta> < v\<^sub>e

goal (1 subgoal):
 1. v\<^sub>o + a\<^sub>o * \<delta> \<le> v\<^sub>e
[PROOF STEP]
unfolding other.s'_def
[PROOF STATE]
proof (prove)
using this:
(if \<delta> \<le> other.t_stop then other.p' \<delta> else 0) < v\<^sub>e

goal (1 subgoal):
 1. v\<^sub>o + a\<^sub>o * \<delta> \<le> v\<^sub>e
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(if \<delta> \<le> other.t_stop then other.p' \<delta> else 0) < v\<^sub>e
\<delta> \<le> other.t_stop
other.s' \<delta> < v\<^sub>e
\<not> (a\<^sub>e < a\<^sub>o \<and> other.s' \<delta> < v\<^sub>e \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> < 0)

goal (1 subgoal):
 1. v\<^sub>o + a\<^sub>o * \<delta> \<le> v\<^sub>e
[PROOF STEP]
unfolding other.p'_def
[PROOF STATE]
proof (prove)
using this:
(if \<delta> \<le> other.t_stop then v\<^sub>o + a\<^sub>o * \<delta> else 0) < v\<^sub>e
\<delta> \<le> other.t_stop
other.s' \<delta> < v\<^sub>e
\<not> (a\<^sub>e < a\<^sub>o \<and> other.s' \<delta> < v\<^sub>e \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> < 0)

goal (1 subgoal):
 1. v\<^sub>o + a\<^sub>o * \<delta> \<le> v\<^sub>e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v\<^sub>o + a\<^sub>o * \<delta> \<le> v\<^sub>e

goal (1 subgoal):
 1. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
have vo_star_nneg: "v\<^sub>o + a\<^sub>o * \<delta> \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> v\<^sub>o + a\<^sub>o * \<delta>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> v\<^sub>o + a\<^sub>o * \<delta>
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
\<delta> \<le> other.t_stop
[PROOF STEP]
have "- v\<^sub>o \<le> a\<^sub>o * \<delta>"
[PROOF STATE]
proof (prove)
using this:
\<delta> \<le> other.t_stop

goal (1 subgoal):
 1. - v\<^sub>o \<le> a\<^sub>o * \<delta>
[PROOF STEP]
unfolding other.t_stop_def
[PROOF STATE]
proof (prove)
using this:
\<delta> \<le> - v\<^sub>o / a\<^sub>o

goal (1 subgoal):
 1. - v\<^sub>o \<le> a\<^sub>o * \<delta>
[PROOF STEP]
using decelerate_other
[PROOF STATE]
proof (prove)
using this:
\<delta> \<le> - v\<^sub>o / a\<^sub>o
a\<^sub>o < 0

goal (1 subgoal):
 1. - v\<^sub>o \<le> a\<^sub>o * \<delta>
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
- v\<^sub>o \<le> a\<^sub>o * \<delta>

goal (1 subgoal):
 1. 0 \<le> v\<^sub>o + a\<^sub>o * \<delta>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
- v\<^sub>o \<le> a\<^sub>o * \<delta>

goal (1 subgoal):
 1. 0 \<le> v\<^sub>o + a\<^sub>o * \<delta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> v\<^sub>o + a\<^sub>o * \<delta>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> v\<^sub>o + a\<^sub>o * \<delta>

goal (1 subgoal):
 1. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
with mult_mono[OF \<open>v\<^sub>o + a\<^sub>o * \<delta> \<le> v\<^sub>e\<close> \<open>v\<^sub>o + a\<^sub>o * \<delta> \<le> v\<^sub>e\<close>]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> v\<^sub>e; 0 \<le> v\<^sub>o + a\<^sub>o * \<delta>\<rbrakk> \<Longrightarrow> (v\<^sub>o + a\<^sub>o * \<delta>) * (v\<^sub>o + a\<^sub>o * \<delta>) \<le> v\<^sub>e * v\<^sub>e
0 \<le> v\<^sub>o + a\<^sub>o * \<delta>
[PROOF STEP]
have *: "(v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 \<le> v\<^sub>e\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> v\<^sub>e; 0 \<le> v\<^sub>o + a\<^sub>o * \<delta>\<rbrakk> \<Longrightarrow> (v\<^sub>o + a\<^sub>o * \<delta>) * (v\<^sub>o + a\<^sub>o * \<delta>) \<le> v\<^sub>e * v\<^sub>e
0 \<le> v\<^sub>o + a\<^sub>o * \<delta>

goal (1 subgoal):
 1. (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 \<le> v\<^sub>e\<^sup>2
[PROOF STEP]
using nonneg_vel_ego
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> v\<^sub>e; 0 \<le> v\<^sub>o + a\<^sub>o * \<delta>\<rbrakk> \<Longrightarrow> (v\<^sub>o + a\<^sub>o * \<delta>) * (v\<^sub>o + a\<^sub>o * \<delta>) \<le> v\<^sub>e * v\<^sub>e
0 \<le> v\<^sub>o + a\<^sub>o * \<delta>
0 \<le> v\<^sub>e

goal (1 subgoal):
 1. (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 \<le> v\<^sub>e\<^sup>2
[PROOF STEP]
by (auto simp add:power_def)
[PROOF STATE]
proof (state)
this:
(v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 \<le> v\<^sub>e\<^sup>2

goal (1 subgoal):
 1. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
from \<open>a\<^sub>o \<le> a\<^sub>e\<close>
[PROOF STATE]
proof (chain)
picking this:
a\<^sub>o \<le> a\<^sub>e
[PROOF STEP]
have "- 1 /a\<^sub>o \<le> - 1 / a\<^sub>e"
[PROOF STATE]
proof (prove)
using this:
a\<^sub>o \<le> a\<^sub>e

goal (1 subgoal):
 1. - 1 / a\<^sub>o \<le> - 1 / a\<^sub>e
[PROOF STEP]
using decelerate_ego decelerate_other
[PROOF STATE]
proof (prove)
using this:
a\<^sub>o \<le> a\<^sub>e
a\<^sub>e < 0
a\<^sub>o < 0

goal (1 subgoal):
 1. - 1 / a\<^sub>o \<le> - 1 / a\<^sub>e
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
- 1 / a\<^sub>o \<le> - 1 / a\<^sub>e

goal (1 subgoal):
 1. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
from mult_mono[OF * this]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> v\<^sub>e\<^sup>2; 0 \<le> - 1 / a\<^sub>o\<rbrakk> \<Longrightarrow> (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 * (- 1 / a\<^sub>o) \<le> v\<^sub>e\<^sup>2 * (- 1 / a\<^sub>e)
[PROOF STEP]
have "(v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 * (- 1 / a\<^sub>o) \<le> v\<^sub>e\<^sup>2 * (- 1 / a\<^sub>e)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> v\<^sub>e\<^sup>2; 0 \<le> - 1 / a\<^sub>o\<rbrakk> \<Longrightarrow> (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 * (- 1 / a\<^sub>o) \<le> v\<^sub>e\<^sup>2 * (- 1 / a\<^sub>e)

goal (1 subgoal):
 1. (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 * (- 1 / a\<^sub>o) \<le> v\<^sub>e\<^sup>2 * (- 1 / a\<^sub>e)
[PROOF STEP]
using nonneg_vel_ego decelerate_other
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> v\<^sub>e\<^sup>2; 0 \<le> - 1 / a\<^sub>o\<rbrakk> \<Longrightarrow> (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 * (- 1 / a\<^sub>o) \<le> v\<^sub>e\<^sup>2 * (- 1 / a\<^sub>e)
0 \<le> v\<^sub>e
a\<^sub>o < 0

goal (1 subgoal):
 1. (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 * (- 1 / a\<^sub>o) \<le> v\<^sub>e\<^sup>2 * (- 1 / a\<^sub>e)
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
(v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 * (- 1 / a\<^sub>o) \<le> v\<^sub>e\<^sup>2 * (- 1 / a\<^sub>e)

goal (1 subgoal):
 1. \<not> 0 \<le> v\<^sub>e - a\<^sub>e / a\<^sub>o * other.s' \<delta> \<Longrightarrow> 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 * (- 1 / a\<^sub>o) \<le> v\<^sub>e\<^sup>2 * (- 1 / a\<^sub>e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 * (- 1 / a\<^sub>o) \<le> v\<^sub>e\<^sup>2 * (- 1 / a\<^sub>e)

goal (1 subgoal):
 1. 0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> - v\<^sub>e\<^sup>2 / a\<^sub>e / 2 + (v\<^sub>o + a\<^sub>o * \<delta>)\<^sup>2 / a\<^sub>o / 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_list_eval:
  fixes f :: "'a \<Rightarrow> 'b::{ring,semiring_1}"
  shows "sum_list (map f xs) = (\<Sum>x \<in> set xs. of_nat (count_list xs x) * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map f xs) = (\<Sum>x\<in>set xs. of_nat (count_list xs x) * f x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_list (map f xs) = (\<Sum>x\<in>set xs. of_nat (count_list xs x) * f x)
[PROOF STEP]
define M where "M = mset xs"
[PROOF STATE]
proof (state)
this:
M = mset xs

goal (1 subgoal):
 1. sum_list (map f xs) = (\<Sum>x\<in>set xs. of_nat (count_list xs x) * f x)
[PROOF STEP]
have "sum_mset (image_mset f M) = (\<Sum>x \<in> set_mset M. of_nat (count M x) * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x)
[PROOF STEP]
proof (induction "M" rule:disj_induct_mset)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<Sum>\<^sub># (image_mset f {#}) = (\<Sum>x\<in>set_mset {#}. of_nat (count {#} x) * f x)
 2. \<And>n M x. \<lbrakk>\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x); x \<notin># M; 0 < n\<rbrakk> \<Longrightarrow> \<Sum>\<^sub># (image_mset f (M + replicate_mset n x)) = (\<Sum>xa\<in>set_mset (M + replicate_mset n x). of_nat (count (M + replicate_mset n x) xa) * f xa)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<Sum>\<^sub># (image_mset f {#}) = (\<Sum>x\<in>set_mset {#}. of_nat (count {#} x) * f x)
 2. \<And>n M x. \<lbrakk>\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x); x \<notin># M; 0 < n\<rbrakk> \<Longrightarrow> \<Sum>\<^sub># (image_mset f (M + replicate_mset n x)) = (\<Sum>xa\<in>set_mset (M + replicate_mset n x). of_nat (count (M + replicate_mset n x) xa) * f xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f {#}) = (\<Sum>x\<in>set_mset {#}. of_nat (count {#} x) * f x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># (image_mset f {#}) = (\<Sum>x\<in>set_mset {#}. of_nat (count {#} x) * f x)

goal (1 subgoal):
 1. \<And>n M x. \<lbrakk>\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x); x \<notin># M; 0 < n\<rbrakk> \<Longrightarrow> \<Sum>\<^sub># (image_mset f (M + replicate_mset n x)) = (\<Sum>xa\<in>set_mset (M + replicate_mset n x). of_nat (count (M + replicate_mset n x) xa) * f xa)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n M x. \<lbrakk>\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x); x \<notin># M; 0 < n\<rbrakk> \<Longrightarrow> \<Sum>\<^sub># (image_mset f (M + replicate_mset n x)) = (\<Sum>xa\<in>set_mset (M + replicate_mset n x). of_nat (count (M + replicate_mset n x) xa) * f xa)
[PROOF STEP]
case (2 n M x)
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x)
x \<notin># M
0 < n

goal (1 subgoal):
 1. \<And>n M x. \<lbrakk>\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x); x \<notin># M; 0 < n\<rbrakk> \<Longrightarrow> \<Sum>\<^sub># (image_mset f (M + replicate_mset n x)) = (\<Sum>xa\<in>set_mset (M + replicate_mset n x). of_nat (count (M + replicate_mset n x) xa) * f xa)
[PROOF STEP]
have a:"\<And>y. y \<in> set_mset M \<Longrightarrow> y \<noteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y \<in># M \<Longrightarrow> y \<noteq> x
[PROOF STEP]
using 2(2)
[PROOF STATE]
proof (prove)
using this:
x \<notin># M

goal (1 subgoal):
 1. \<And>y. y \<in># M \<Longrightarrow> y \<noteq> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?y \<in># M \<Longrightarrow> ?y \<noteq> x

goal (1 subgoal):
 1. \<And>n M x. \<lbrakk>\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x); x \<notin># M; 0 < n\<rbrakk> \<Longrightarrow> \<Sum>\<^sub># (image_mset f (M + replicate_mset n x)) = (\<Sum>xa\<in>set_mset (M + replicate_mset n x). of_nat (count (M + replicate_mset n x) xa) * f xa)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f (M + replicate_mset n x)) = (\<Sum>xa\<in>set_mset (M + replicate_mset n x). of_nat (count (M + replicate_mset n x) xa) * f xa)
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x)
x \<notin># M
0 < n

goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f (M + replicate_mset n x)) = (\<Sum>xa\<in>set_mset (M + replicate_mset n x). of_nat (count (M + replicate_mset n x) xa) * f xa)
[PROOF STEP]
by (simp add:a  count_eq_zero_iff[symmetric])
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># (image_mset f (M + replicate_mset n x)) = (\<Sum>xa\<in>set_mset (M + replicate_mset n x). of_nat (count (M + replicate_mset n x) xa) * f xa)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x)

goal (1 subgoal):
 1. sum_list (map f xs) = (\<Sum>x\<in>set xs. of_nat (count_list xs x) * f x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x)

goal (1 subgoal):
 1. sum_list (map f xs) = (\<Sum>x\<in>set xs. of_nat (count_list xs x) * f x)
[PROOF STEP]
have "\<And>x. count_list xs x = count (mset xs) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. count_list xs x = count (mset xs) x
[PROOF STEP]
by (induction xs, simp, simp)
[PROOF STATE]
proof (state)
this:
count_list xs ?x = count (mset xs) ?x

goal (1 subgoal):
 1. sum_list (map f xs) = (\<Sum>x\<in>set xs. of_nat (count_list xs x) * f x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x)
count_list xs ?x = count (mset xs) ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Sum>\<^sub># (image_mset f M) = (\<Sum>x\<in>set_mset M. of_nat (count M x) * f x)
count_list xs ?x = count (mset xs) ?x

goal (1 subgoal):
 1. sum_list (map f xs) = (\<Sum>x\<in>set xs. of_nat (count_list xs x) * f x)
[PROOF STEP]
by (simp add:M_def sum_mset_sum_list[symmetric])
[PROOF STATE]
proof (state)
this:
sum_list (map f xs) = (\<Sum>x\<in>set xs. of_nat (count_list xs x) * f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nn_set_integral_cong:
  assumes "AE x in M. f x = g x"
  shows "(\<integral>\<^sup>+x \<in> A. f x \<partial>M) = (\<integral>\<^sup>+x \<in> A. g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M A f = set_nn_integral M A g
[PROOF STEP]
apply (rule nn_integral_cong_AE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. f x * indicator A x = g x * indicator A x
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
AE x in M. f x = g x

goal (1 subgoal):
 1. AE x in M. f x * indicator A x = g x * indicator A x
[PROOF STEP]
by auto


[STATEMENT]
lemma map_transform_cong:
  "(\<And>x. x \<in> domA m1 \<Longrightarrow> ae x = ae' x) \<Longrightarrow> m1 = m2 \<Longrightarrow> map_transform t ae m1 = map_transform t ae' m2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> domA m1 \<Longrightarrow> ae x = ae' x; m1 = m2\<rbrakk> \<Longrightarrow> map_transform t ae m1 = map_transform t ae' m2
[PROOF STEP]
unfolding map_transform_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> domA m1 \<Longrightarrow> ae x = ae' x; m1 = m2\<rbrakk> \<Longrightarrow> map_ran (\<lambda>x. lift_transform t (ae x)) m1 = map_ran (\<lambda>x. lift_transform t (ae' x)) m2
[PROOF STEP]
by (auto intro!: map_ran_cong dest: domA_from_set)


[STATEMENT]
lemma fps_left_inverse_idempotent_ring1:
  fixes   f :: "'a::ring_1 fps"
  assumes "x * f$0 = 1" "y * x = 1"
  \<comment> \<open>These assumptions imply y equals f$0, but no need to assume that.\<close>
  shows   "fps_left_inverse (fps_left_inverse f x) y = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_left_inverse (fps_left_inverse f x) y = f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fps_left_inverse (fps_left_inverse f x) y = f
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
x * f $ 0 = (1::'a)
[PROOF STEP]
have
    "fps_left_inverse (fps_left_inverse f x) y * fps_left_inverse f x * f =
      fps_left_inverse (fps_left_inverse f x) y"
[PROOF STATE]
proof (prove)
using this:
x * f $ 0 = (1::'a)

goal (1 subgoal):
 1. fps_left_inverse (fps_left_inverse f x) y * fps_left_inverse f x * f = fps_left_inverse (fps_left_inverse f x) y
[PROOF STEP]
by (simp add: fps_left_inverse mult.assoc)
[PROOF STATE]
proof (state)
this:
fps_left_inverse (fps_left_inverse f x) y * fps_left_inverse f x * f = fps_left_inverse (fps_left_inverse f x) y

goal (1 subgoal):
 1. fps_left_inverse (fps_left_inverse f x) y = f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fps_left_inverse (fps_left_inverse f x) y * fps_left_inverse f x * f = fps_left_inverse (fps_left_inverse f x) y

goal (1 subgoal):
 1. fps_left_inverse (fps_left_inverse f x) y = f
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
y * x = (1::'a)
[PROOF STEP]
have
    "fps_left_inverse (fps_left_inverse f x) y * fps_left_inverse f x = 1"
[PROOF STATE]
proof (prove)
using this:
y * x = (1::'a)

goal (1 subgoal):
 1. fps_left_inverse (fps_left_inverse f x) y * fps_left_inverse f x = 1
[PROOF STEP]
by (simp add: fps_left_inverse)
[PROOF STATE]
proof (state)
this:
fps_left_inverse (fps_left_inverse f x) y * fps_left_inverse f x = 1

goal (1 subgoal):
 1. fps_left_inverse (fps_left_inverse f x) y = f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fps_left_inverse (fps_left_inverse f x) y * fps_left_inverse f x * f = fps_left_inverse (fps_left_inverse f x) y
fps_left_inverse (fps_left_inverse f x) y * fps_left_inverse f x = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fps_left_inverse (fps_left_inverse f x) y * fps_left_inverse f x * f = fps_left_inverse (fps_left_inverse f x) y
fps_left_inverse (fps_left_inverse f x) y * fps_left_inverse f x = 1

goal (1 subgoal):
 1. fps_left_inverse (fps_left_inverse f x) y = f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fps_left_inverse (fps_left_inverse f x) y = f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distinct_map_eq: "\<lbrakk> distinct (List.map f l); f x = f y; x\<in>set l; y\<in>set l \<rbrakk> \<Longrightarrow> x=y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct (map f l); f x = f y; x \<in> set l; y \<in> set l\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (erule (2) xy_in_set_cases) auto


[STATEMENT]
lemma padic_set_memI':
  fixes f :: "padic_int"
  assumes "\<And>m. (f m) \<in> {0..<p^m}"
  assumes "\<And>(m::nat) n. n > m \<Longrightarrow> (f n) mod p^m = (f m)"
  shows "f \<in> padic_set (p::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> padic_set p
[PROOF STEP]
apply(rule padic_set_memI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m. f m \<in> carrier (residue_ring (p ^ m))
 2. \<And>m n. m < n \<Longrightarrow> residue (p ^ m) (f n) = f m
[PROOF STEP]
using assms(1) residue_ring_def
[PROOF STATE]
proof (prove)
using this:
f ?m \<in> {0..<p ^ ?m}
residue_ring ?m = \<lparr>carrier = {0..?m - 1}, monoid.mult = \<lambda>x y. x * y mod ?m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod ?m\<rparr>

goal (2 subgoals):
 1. \<And>m. f m \<in> carrier (residue_ring (p ^ m))
 2. \<And>m n. m < n \<Longrightarrow> residue (p ^ m) (f n) = f m
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. m < n \<Longrightarrow> residue (p ^ m) (f n) = f m
[PROOF STEP]
by (simp add: assms(2) residue_def)


[STATEMENT]
lemma powr_0 [simp]: "0 powr z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) powr z = (0::'a)
[PROOF STEP]
by (simp add: powr_def)


[STATEMENT]
lemma cprod_assoc: "(r *c s) *c t =o r *c s *c t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r *c s) *c t =o r *c s *c t
[PROOF STEP]
unfolding cprod_def Field_card_of
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |(Field r \<times> Field s) \<times> Field t| =o |Field r \<times> Field s \<times> Field t|
[PROOF STEP]
by (rule card_of_Times_assoc)


[STATEMENT]
lemma summable_imp_bounded:
  fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
  shows "summable f \<Longrightarrow> bounded (range f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f \<Longrightarrow> bounded (range f)
[PROOF STEP]
by (frule summable_LIMSEQ_zero) (simp add: convergent_imp_bounded)


[STATEMENT]
lemma fps_of_poly_add: "fps_of_poly (p + q) = fps_of_poly p + fps_of_poly q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (p + q) = fps_of_poly p + fps_of_poly q
[PROOF STEP]
by (simp add: fps_of_poly_def plus_poly.rep_eq fps_plus_def)


[STATEMENT]
lemma minus_le_self_iff: "- a \<le> a \<longleftrightarrow> 0 \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- a \<le> a) = ((0::'a) \<le> a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- a \<le> a) = ((0::'a) \<le> a)
[PROOF STEP]
have "- a \<le> a \<longleftrightarrow> 0 \<le> a + a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- a \<le> a) = ((0::'a) \<le> a + a)
[PROOF STEP]
using add_le_cancel_left [of "uminus a" zero "plus a a"]
[PROOF STATE]
proof (prove)
using this:
(- a + (0::'a) \<le> - a + (a + a)) = ((0::'a) \<le> a + a)

goal (1 subgoal):
 1. (- a \<le> a) = ((0::'a) \<le> a + a)
[PROOF STEP]
by (simp flip: add.assoc)
[PROOF STATE]
proof (state)
this:
(- a \<le> a) = ((0::'a) \<le> a + a)

goal (1 subgoal):
 1. (- a \<le> a) = ((0::'a) \<le> a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(- a \<le> a) = ((0::'a) \<le> a + a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(- a \<le> a) = ((0::'a) \<le> a + a)

goal (1 subgoal):
 1. (- a \<le> a) = ((0::'a) \<le> a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(- a \<le> a) = ((0::'a) \<le> a)

goal:
No subgoals!
[PROOF STEP]
qed