[STATEMENT]
lemma unitarily_equiv_uminus:
  assumes "A\<in> carrier_mat n n"
  and "unitarily_equiv A B U"
  shows "unitarily_equiv (-A) (-B) U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitarily_equiv (- A) (- B) U
[PROOF STEP]
proof (rule unitarily_equivI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. similar_mat_wit (- A) (- B) U (Complex_Matrix.adjoint U)
 2. Complex_Matrix.unitary U
[PROOF STEP]
show "similar_mat_wit (-A) (-B) U (Complex_Matrix.adjoint U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat_wit (- A) (- B) U (Complex_Matrix.adjoint U)
[PROOF STEP]
using mat_conj_uminus_eq assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?U \<in> carrier_mat ?n ?n; ?B \<in> carrier_mat ?n ?n; ?A = mat_conj ?U ?B\<rbrakk> \<Longrightarrow> - ?A = mat_conj ?U (- ?B)
A \<in> carrier_mat n n
unitarily_equiv A B U

goal (1 subgoal):
 1. similar_mat_wit (- A) (- B) U (Complex_Matrix.adjoint U)
[PROOF STEP]
by (smt (z3) adjoint_dim_col adjoint_dim_row carrier_matD(1)
        carrier_matD(2) carrier_mat_triv index_uminus_mat(2)
        index_uminus_mat(3) similar_mat_witI unitarily_equivD(1)
        unitarily_equiv_carrier(1) unitarily_equiv_carrier(2)
        unitarily_equiv_eq unitary_simps(1) unitary_simps(2) mat_conj_def)
[PROOF STATE]
proof (state)
this:
similar_mat_wit (- A) (- B) U (Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. Complex_Matrix.unitary U
[PROOF STEP]
show "unitary U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary U
[PROOF STEP]
using assms unitarily_equivD(1)[of A]
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
unitarily_equiv A B U
unitarily_equiv A ?B ?U \<Longrightarrow> Complex_Matrix.unitary ?U

goal (1 subgoal):
 1. Complex_Matrix.unitary U
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.unitary U

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma emeasure_lborel_cball_finite: "emeasure lborel (cball c r) < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel (cball c r) < \<infinity>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure lborel (cball c r) < \<infinity>
[PROOF STEP]
have "bounded (cball c r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (cball c r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bounded (cball c r)

goal (1 subgoal):
 1. emeasure lborel (cball c r) < \<infinity>
[PROOF STEP]
from bounded_subset_cbox_symmetric[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>a. cball c r \<subseteq> cbox (- a) a \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain a where a: "cball c r \<subseteq> cbox (-a) a"
[PROOF STATE]
proof (prove)
using this:
(\<And>a. cball c r \<subseteq> cbox (- a) a \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>a. cball c r \<subseteq> cbox (- a) a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cball c r \<subseteq> cbox (- a) a

goal (1 subgoal):
 1. emeasure lborel (cball c r) < \<infinity>
[PROOF STEP]
hence "emeasure lborel (cball c r) \<le> emeasure lborel (cbox (-a) a)"
[PROOF STATE]
proof (prove)
using this:
cball c r \<subseteq> cbox (- a) a

goal (1 subgoal):
 1. emeasure lborel (cball c r) \<le> emeasure lborel (cbox (- a) a)
[PROOF STEP]
by (intro emeasure_mono) auto
[PROOF STATE]
proof (state)
this:
emeasure lborel (cball c r) \<le> emeasure lborel (cbox (- a) a)

goal (1 subgoal):
 1. emeasure lborel (cball c r) < \<infinity>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure lborel (cball c r) \<le> emeasure lborel (cbox (- a) a)

goal (1 subgoal):
 1. emeasure lborel (cball c r) < \<infinity>
[PROOF STEP]
have "\<dots> < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel (cbox (- a) a) < \<infinity>
[PROOF STEP]
by (simp add: emeasure_lborel_cbox_eq)
[PROOF STATE]
proof (state)
this:
emeasure lborel (cbox (- a) a) < \<infinity>

goal (1 subgoal):
 1. emeasure lborel (cball c r) < \<infinity>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure lborel (cball c r) < \<infinity>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure lborel (cball c r) < \<infinity>

goal (1 subgoal):
 1. emeasure lborel (cball c r) < \<infinity>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure lborel (cball c r) < \<infinity>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zeta_remove_zero:
  assumes "Re s \<ge> 1"
  shows   "(s - 1) * pre_zeta 1 s + 1 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
[PROOF STEP]
proof (cases "s = 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. s = 1 \<Longrightarrow> (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
 2. s \<noteq> 1 \<Longrightarrow> (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
s \<noteq> 1

goal (2 subgoals):
 1. s = 1 \<Longrightarrow> (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
 2. s \<noteq> 1 \<Longrightarrow> (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
[PROOF STEP]
hence "(s - 1) * pre_zeta 1 s + 1 = (s - 1) * zeta s"
[PROOF STATE]
proof (prove)
using this:
s \<noteq> 1

goal (1 subgoal):
 1. (s - 1) * pre_zeta 1 s + 1 = (s - 1) * zeta s
[PROOF STEP]
by (simp add: zeta_def hurwitz_zeta_def divide_simps)
[PROOF STATE]
proof (state)
this:
(s - 1) * pre_zeta 1 s + 1 = (s - 1) * zeta s

goal (2 subgoals):
 1. s = 1 \<Longrightarrow> (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
 2. s \<noteq> 1 \<Longrightarrow> (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(s - 1) * pre_zeta 1 s + 1 = (s - 1) * zeta s

goal (2 subgoals):
 1. s = 1 \<Longrightarrow> (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
 2. s \<noteq> 1 \<Longrightarrow> (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
[PROOF STEP]
from False assms
[PROOF STATE]
proof (chain)
picking this:
s \<noteq> 1
1 \<le> Re s
[PROOF STEP]
have "\<dots> \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
s \<noteq> 1
1 \<le> Re s

goal (1 subgoal):
 1. (s - 1) * zeta s \<noteq> 0
[PROOF STEP]
using zeta_Re_ge_1_nonzero[of s]
[PROOF STATE]
proof (prove)
using this:
s \<noteq> 1
1 \<le> Re s
\<lbrakk>1 \<le> Re s; s \<noteq> 1\<rbrakk> \<Longrightarrow> zeta s \<noteq> 0

goal (1 subgoal):
 1. (s - 1) * zeta s \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(s - 1) * zeta s \<noteq> 0

goal (2 subgoals):
 1. s = 1 \<Longrightarrow> (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
 2. s \<noteq> 1 \<Longrightarrow> (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(s - 1) * pre_zeta 1 s + 1 \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(s - 1) * pre_zeta 1 s + 1 \<noteq> 0

goal (1 subgoal):
 1. (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(s - 1) * pre_zeta 1 s + 1 \<noteq> 0

goal (1 subgoal):
 1. s = 1 \<Longrightarrow> (s - 1) * pre_zeta 1 s + 1 \<noteq> 0
[PROOF STEP]
qed auto


[STATEMENT]
lemma divide_out_unique_nat:
  fixes n :: nat
  assumes "\<not>is_unit p" "p \<noteq> 0" "\<not>p dvd m" and "n = p ^ k * m"
  shows   "m = n div p ^ multiplicity p n" and "k = multiplicity p n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m = n div p ^ multiplicity p n &&& k = multiplicity p n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = n div p ^ multiplicity p n
 2. k = multiplicity p n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<not> is_unit p
p \<noteq> 0
\<not> p dvd m
n = p ^ k * m
[PROOF STEP]
have "n \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> is_unit p
p \<noteq> 0
\<not> p dvd m
n = p ^ k * m

goal (1 subgoal):
 1. n \<noteq> 0
[PROOF STEP]
by (intro notI) auto
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. m = n div p ^ multiplicity p n
 2. k = multiplicity p n
[PROOF STEP]
thus *: "k = multiplicity p n"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. k = multiplicity p n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
\<not> is_unit p
p \<noteq> 0
\<not> p dvd m
n = p ^ k * m

goal (1 subgoal):
 1. k = multiplicity p n
[PROOF STEP]
by (auto simp: assms multiplicity_times_same_power not_dvd_imp_multiplicity_0)
[PROOF STATE]
proof (state)
this:
k = multiplicity p n

goal (1 subgoal):
 1. m = n div p ^ multiplicity p n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<not> is_unit p
p \<noteq> 0
\<not> p dvd m
n = p ^ k * m
[PROOF STEP]
show "m = n div p ^ multiplicity p n"
[PROOF STATE]
proof (prove)
using this:
\<not> is_unit p
p \<noteq> 0
\<not> p dvd m
n = p ^ k * m

goal (1 subgoal):
 1. m = n div p ^ multiplicity p n
[PROOF STEP]
unfolding * [symmetric]
[PROOF STATE]
proof (prove)
using this:
\<not> is_unit p
p \<noteq> 0
\<not> p dvd m
n = p ^ k * m

goal (1 subgoal):
 1. m = n div p ^ k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m = n div p ^ multiplicity p n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma num_unique_vars_Fun_Cons:
  "num_unique_vars (Fun f (t # ts)) \<le> num_unique_vars t + num_unique_vars (Fun f ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. num_unique_vars (Fun f (t # ts)) \<le> num_unique_vars t + num_unique_vars (Fun f ts)
[PROOF STEP]
apply (simp_all add: num_unique_vars_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (vars_term t \<union> \<Union> (vars_term ` set ts)) \<le> card (vars_term t) + card (\<Union> (vars_term ` set ts))
[PROOF STEP]
unfolding card_Un_Int [OF finite_vars_term finite_Union_vars_term]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (vars_term t \<union> \<Union> (vars_term ` set ts)) \<le> card (vars_term t \<union> \<Union> (vars_term ` set ts)) + card (vars_term t \<inter> \<Union> (vars_term ` set ts))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma arccos_minus_1 [simp]: "arccos (- 1) = pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arccos (- 1) = pi
[PROOF STEP]
by (metis arccos_cos cos_pi order_refl pi_ge_zero)


[STATEMENT]
lemma round_unique: "of_int y > x - 1/2 \<Longrightarrow> of_int y \<le> x + 1/2 \<Longrightarrow> round x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x - (1::'a) / (2::'a) < of_int y; of_int y \<le> x + (1::'a) / (2::'a)\<rbrakk> \<Longrightarrow> round x = y
[PROOF STEP]
unfolding round_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x - (1::'a) / (2::'a) < of_int y; of_int y \<le> x + (1::'a) / (2::'a)\<rbrakk> \<Longrightarrow> \<lfloor>x + (1::'a) / (2::'a)\<rfloor> = y
[PROOF STEP]
proof (rule floor_unique)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x - (1::'a) / (2::'a) < of_int y; of_int y \<le> x + (1::'a) / (2::'a)\<rbrakk> \<Longrightarrow> of_int y \<le> x + (1::'a) / (2::'a)
 2. \<lbrakk>x - (1::'a) / (2::'a) < of_int y; of_int y \<le> x + (1::'a) / (2::'a)\<rbrakk> \<Longrightarrow> x + (1::'a) / (2::'a) < of_int y + (1::'a)
[PROOF STEP]
assume "x - 1 / 2 < of_int y"
[PROOF STATE]
proof (state)
this:
x - (1::'a) / (2::'a) < of_int y

goal (2 subgoals):
 1. \<lbrakk>x - (1::'a) / (2::'a) < of_int y; of_int y \<le> x + (1::'a) / (2::'a)\<rbrakk> \<Longrightarrow> of_int y \<le> x + (1::'a) / (2::'a)
 2. \<lbrakk>x - (1::'a) / (2::'a) < of_int y; of_int y \<le> x + (1::'a) / (2::'a)\<rbrakk> \<Longrightarrow> x + (1::'a) / (2::'a) < of_int y + (1::'a)
[PROOF STEP]
from add_strict_left_mono[OF this, of 1]
[PROOF STATE]
proof (chain)
picking this:
(1::'a) + (x - (1::'a) / (2::'a)) < (1::'a) + of_int y
[PROOF STEP]
show "x + 1 / 2 < of_int y + 1"
[PROOF STATE]
proof (prove)
using this:
(1::'a) + (x - (1::'a) / (2::'a)) < (1::'a) + of_int y

goal (1 subgoal):
 1. x + (1::'a) / (2::'a) < of_int y + (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x + (1::'a) / (2::'a) < of_int y + (1::'a)

goal (1 subgoal):
 1. \<lbrakk>x - (1::'a) / (2::'a) < of_int y; of_int y \<le> x + (1::'a) / (2::'a)\<rbrakk> \<Longrightarrow> of_int y \<le> x + (1::'a) / (2::'a)
[PROOF STEP]
qed


[STATEMENT]
theorem list_order_consistent:
  assumes "list_ops some_ops" and "list_ops all_ops"
    and "set some_ops \<subseteq> set all_ops"
    and "list_order some_ops x y"
  shows "list_order all_ops x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List_Spec.list_order all_ops x y
[PROOF STEP]
using assms list_order_monotonic list_ops_insertions insertions_subset list_order_equiv
[PROOF STATE]
proof (prove)
using this:
list_ops some_ops
list_ops all_ops
set some_ops \<subseteq> set all_ops
List_Spec.list_order some_ops x y
\<lbrakk>insert_ops ?A; insert_ops ?B; set ?A \<subseteq> set ?B; Insert_Spec.list_order ?A ?x ?y\<rbrakk> \<Longrightarrow> Insert_Spec.list_order ?B ?x ?y
list_ops ?ops \<Longrightarrow> insert_ops (insertions ?ops)
\<lbrakk>list_ops ?A; list_ops ?B; set ?A \<subseteq> set ?B\<rbrakk> \<Longrightarrow> set (insertions ?A) \<subseteq> set (insertions ?B)
List_Spec.list_order ?ops ?x ?y = Insert_Spec.list_order (insertions ?ops) ?x ?y

goal (1 subgoal):
 1. List_Spec.list_order all_ops x y
[PROOF STEP]
by metis


[STATEMENT]
lemma zero_cong: "\<zero> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero> = 0
[PROOF STEP]
by (auto simp: R_m_def residue_ring_def)


[STATEMENT]
lemma contour_integral_reverse_linepath:
    "continuous_on (closed_segment a b) f
     \<Longrightarrow> contour_integral (linepath a b) f = - (contour_integral(linepath b a) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (closed_segment a b) f \<Longrightarrow> contour_integral (linepath a b) f = - contour_integral (linepath b a) f
[PROOF STEP]
by (metis contour_integrable_continuous_linepath contour_integral_unique has_contour_integral_integral has_contour_integral_reverse_linepath)


[STATEMENT]
lemma iter_tensor_values:
  fixes A n i j
  assumes "n \<ge> 1" and "i < dim_row (A \<Otimes> (A \<otimes>\<^bsup>n\<^esup>))" and "j < dim_col (A \<Otimes> (A \<otimes>\<^bsup>n\<^esup>))"
  shows "(A \<otimes>\<^bsup>(Suc n)\<^esup>) $$ (i,j) = (A \<Otimes> (A \<otimes>\<^bsup>n\<^esup>)) $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<otimes>\<^bsup>Suc n\<^esup>) $$ (i, j) = (A \<Otimes> A \<otimes>\<^bsup>n\<^esup>) $$ (i, j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> n
i < dim_row (A \<Otimes> A \<otimes>\<^bsup>n\<^esup>)
j < dim_col (A \<Otimes> A \<otimes>\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. (A \<otimes>\<^bsup>Suc n\<^esup>) $$ (i, j) = (A \<Otimes> A \<otimes>\<^bsup>n\<^esup>) $$ (i, j)
[PROOF STEP]
by (metis One_nat_def le_0_eq not0_implies_Suc iter_tensor.simps(2))


[STATEMENT]
lemma "(x + y = (0::real)) = (x = -y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y = 0) = (x = - y)
[PROOF STEP]
by arith


[STATEMENT]
theorem quotient_group:
  "Subgroup H \<Longrightarrow> normal H \<Longrightarrow> Group (quotient_group H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Subgroup H; normal H\<rbrakk> \<Longrightarrow> Group (quotient_group H)
[PROOF STEP]
unfolding quotient_group_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Subgroup H; normal H\<rbrakk> \<Longrightarrow> Group (BinOpSetGroup.Abs_G_perm (G // LCoset_rel H) (+) ` G // LCoset_rel H)
[PROOF STEP]
using     BinOpSetGroup.Group[OF BinOpSetGroup_normal_quotient]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Subgroup ?e; normal ?e\<rbrakk> \<Longrightarrow> Group (BinOpSetGroup.Abs_G_perm (G // LCoset_rel ?e) (+) ` G // LCoset_rel ?e)

goal (1 subgoal):
 1. \<lbrakk>Subgroup H; normal H\<rbrakk> \<Longrightarrow> Group (BinOpSetGroup.Abs_G_perm (G // LCoset_rel H) (+) ` G // LCoset_rel H)
[PROOF STEP]
by        auto


[STATEMENT]
lemma root_unity: "root n ^ n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FFT.root n ^ n = 1
[PROOF STEP]
by (simp add: complex_eq_iff root_def DeMoivre)


[STATEMENT]
lemma T_append2: "length qs = length as \<Longrightarrow> T s (qs@qs') (as@as') = T s qs as + T (steps s qs as) qs' as'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length qs = length as \<Longrightarrow> T s (qs @ qs') (as @ as') = T s qs as + T (steps s qs as) qs' as'
[PROOF STEP]
apply(induct qs as arbitrary: s rule: list_induct2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. T s ([] @ qs') ([] @ as') = T s [] [] + T (steps s [] []) qs' as'
 2. \<And>x xs y ys s. \<lbrakk>length xs = length ys; \<And>s. T s (xs @ qs') (ys @ as') = T s xs ys + T (steps s xs ys) qs' as'\<rbrakk> \<Longrightarrow> T s ((x # xs) @ qs') ((y # ys) @ as') = T s (x # xs) (y # ys) + T (steps s (x # xs) (y # ys)) qs' as'
[PROOF STEP]
by simp_all


[STATEMENT]
lemma bisimulation_bisim_compose:
  "\<lbrakk> bisimulation trsys1 trsys2 bisim12 tlsim12; bisimulation trsys2 trsys3 bisim23 tlsim23 \<rbrakk>
  \<Longrightarrow> bisimulation trsys1 trsys3 (bisim_compose bisim12 bisim23) (bisim_compose tlsim12 tlsim23)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bisimulation trsys1 trsys2 bisim12 tlsim12; bisimulation trsys2 trsys3 bisim23 tlsim23\<rbrakk> \<Longrightarrow> bisimulation trsys1 trsys3 (bisim12 \<circ>\<^sub>B bisim23) (tlsim12 \<circ>\<^sub>B tlsim23)
[PROOF STEP]
unfolding delay_bisimulation_conv_bisimulation[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>delay_bisimulation_diverge trsys1 trsys2 bisim12 tlsim12 (\<lambda>s tl s'. False) (\<lambda>s tl s'. False); delay_bisimulation_diverge trsys2 trsys3 bisim23 tlsim23 (\<lambda>s tl s'. False) (\<lambda>s tl s'. False)\<rbrakk> \<Longrightarrow> delay_bisimulation_diverge trsys1 trsys3 (bisim12 \<circ>\<^sub>B bisim23) (tlsim12 \<circ>\<^sub>B tlsim23) (\<lambda>s tl s'. False) (\<lambda>s tl s'. False)
[PROOF STEP]
by(rule delay_bisimulation_diverge_compose)


[STATEMENT]
lemma uncountable_bij_betw: "bij_betw f A B \<Longrightarrow> uncountable B \<Longrightarrow> uncountable A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bij_betw f A B; uncountable B\<rbrakk> \<Longrightarrow> uncountable A
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f A \<and> f ` A = B; uncountable B\<rbrakk> \<Longrightarrow> uncountable A
[PROOF STEP]
by (metis countable_image)


[STATEMENT]
lemma homeomorphic_Borsukian: "\<lbrakk>Borsukian S; S homeomorphic T\<rbrakk> \<Longrightarrow> Borsukian T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Borsukian S; S homeomorphic T\<rbrakk> \<Longrightarrow> Borsukian T
[PROOF STEP]
using Borsukian_retraction_gen order_refl
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Borsukian ?S; continuous_on ?S ?h; ?h ` ?S = ?T; continuous_on ?T ?k; ?k ` ?T \<subseteq> ?S; \<And>y. y \<in> ?T \<Longrightarrow> ?h (?k y) = y\<rbrakk> \<Longrightarrow> Borsukian ?T
?x \<le> ?x

goal (1 subgoal):
 1. \<lbrakk>Borsukian S; S homeomorphic T\<rbrakk> \<Longrightarrow> Borsukian T
[PROOF STEP]
by (fastforce simp add: homeomorphism_def homeomorphic_def)


[STATEMENT]
lemma col_of_dagger [simp]:
  assumes "j < dim_row M"
  shows "col (M\<^sup>\<dagger>) j = vec (dim_col M) (\<lambda>i. cnj (M $$ (j,i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col M\<^sup>\<dagger> j = vec (dim_col M) (\<lambda>i. cnj (M $$ (j, i)))
[PROOF STEP]
using assms col_def dagger_def
[PROOF STATE]
proof (prove)
using this:
j < dim_row M
col ?A ?j = vec (dim_row ?A) (\<lambda>i. ?A $$ (i, ?j))
?M\<^sup>\<dagger> \<equiv> mat (dim_col ?M) (dim_row ?M) (\<lambda>(i, j). cnj (?M $$ (j, i)))

goal (1 subgoal):
 1. col M\<^sup>\<dagger> j = vec (dim_col M) (\<lambda>i. cnj (M $$ (j, i)))
[PROOF STEP]
by simp


[STATEMENT]
lemma real_card_permutations_of_multiset_remove':
  assumes "x \<in># A"
  shows   "real (card (permutations_of_multiset A)) =
             real (size A * card (permutations_of_multiset (A - {#x#}))) / real (count A x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (permutations_of_multiset A)) = real (size A * card (permutations_of_multiset (A - {#x#}))) / real (count A x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in># A

goal (1 subgoal):
 1. real (card (permutations_of_multiset A)) = real (size A * card (permutations_of_multiset (A - {#x#}))) / real (count A x)
[PROOF STEP]
by (subst card_permutations_of_multiset_remove_aux[OF assms, symmetric]) simp


[STATEMENT]
lemma Arcsin_minus_1 [simp]: "Arcsin(-1) = - (pi/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arcsin (- 1) = complex_of_real (- (pi / 2))
[PROOF STEP]
by (metis Arcsin_1 Arcsin_sin Im_complex_of_real Re_complex_of_real abs_of_nonneg of_real_minus pi_half_ge_zero power2_minus real_sqrt_abs sin_Arcsin sin_minus)


[STATEMENT]
lemma satisfiableAppend:
  fixes formula1 :: Formula and formula2 :: Formula
  assumes "satisfiable (formula1 @ formula2)"
  shows "satisfiable formula1" "satisfiable formula2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. satisfiable formula1 &&& satisfiable formula2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
satisfiable (formula1 @ formula2)

goal (1 subgoal):
 1. satisfiable formula1 &&& satisfiable formula2
[PROOF STEP]
unfolding satisfiable_def
[PROOF STATE]
proof (prove)
using this:
\<exists>valuation. model valuation (formula1 @ formula2)

goal (1 subgoal):
 1. \<exists>valuation. model valuation formula1 &&& \<exists>valuation. model valuation formula2
[PROOF STEP]
by (auto simp add:formulaTrueAppend)


[STATEMENT]
lemma real_mult_eq_0_iff:
  assumes a: "is_real a" and b: "is_real b"
  shows "a * b = 0 \<longleftrightarrow> a = 0 \<or> b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * b = (0::'a)) = (a = (0::'a) \<or> b = (0::'a))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a * b = (0::'a)) = (a = (0::'a) \<or> b = (0::'a))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a * b = (0::'a)) = (a = (0::'a) \<or> b = (0::'a))
[PROOF STEP]
assume l: "a * b = 0" and "a \<noteq> 0" and "b \<noteq> 0"
[PROOF STATE]
proof (state)
this:
a * b = (0::'a)
a \<noteq> (0::'a)
b \<noteq> (0::'a)

goal (1 subgoal):
 1. (a * b = (0::'a)) = (a = (0::'a) \<or> b = (0::'a))
[PROOF STEP]
with a b
[PROOF STATE]
proof (chain)
picking this:
is_real a
is_real b
a * b = (0::'a)
a \<noteq> (0::'a)
b \<noteq> (0::'a)
[PROOF STEP]
have "a < 0 \<or> 0 < a" and "b < 0 \<or> 0 < b"
[PROOF STATE]
proof (prove)
using this:
is_real a
is_real b
a * b = (0::'a)
a \<noteq> (0::'a)
b \<noteq> (0::'a)

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

goal (1 subgoal):
 1. (a * b = (0::'a)) = (a = (0::'a) \<or> b = (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a < (0::'a) \<or> (0::'a) < a
b < (0::'a) \<or> (0::'a) < b
[PROOF STEP]
have "False"
[PROOF STATE]
proof (prove)
using this:
a < (0::'a) \<or> (0::'a) < a
b < (0::'a) \<or> (0::'a) < b

goal (1 subgoal):
 1. False
[PROOF STEP]
using mult_pos_pos[of a b] mult_pos_neg[of a b] mult_neg_pos[of a b] mult_neg_neg[of a b]
[PROOF STATE]
proof (prove)
using this:
a < (0::'a) \<or> (0::'a) < a
b < (0::'a) \<or> (0::'a) < b
\<lbrakk>(0::'a) < a; (0::'a) < b\<rbrakk> \<Longrightarrow> (0::'a) < a * b
\<lbrakk>(0::'a) < a; b < (0::'a)\<rbrakk> \<Longrightarrow> a * b < (0::'a)
\<lbrakk>a < (0::'a); (0::'a) < b\<rbrakk> \<Longrightarrow> a * b < (0::'a)
\<lbrakk>a < (0::'a); b < (0::'a)\<rbrakk> \<Longrightarrow> (0::'a) < a * b

goal (1 subgoal):
 1. False
[PROOF STEP]
by (auto simp:l)
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. (a * b = (0::'a)) = (a = (0::'a) \<or> b = (0::'a))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>a * b = (0::'a); a \<noteq> (0::'a); b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. (a * b = (0::'a)) = (a = (0::'a) \<or> b = (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>a * b = (0::'a); a \<noteq> (0::'a); b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a * b = (0::'a); a \<noteq> (0::'a); b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. (a * b = (0::'a)) = (a = (0::'a) \<or> b = (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a * b = (0::'a)) = (a = (0::'a) \<or> b = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma floor_add_int: "\<lfloor>x\<rfloor> + z = \<lfloor>x + of_int z\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>x\<rfloor> + z = \<lfloor>x + of_int z\<rfloor>
[PROOF STEP]
using floor_correct [of x]
[PROOF STATE]
proof (prove)
using this:
of_int \<lfloor>x\<rfloor> \<le> x \<and> x < of_int (\<lfloor>x\<rfloor> + 1)

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> + z = \<lfloor>x + of_int z\<rfloor>
[PROOF STEP]
by (simp add: floor_unique[symmetric])


[STATEMENT]
lemma mat_of_cols_map [simp]:
  assumes x: "set vs \<subseteq> carrier_vec n"
  shows "mat_of_cols n (map (map_vec f) vs) = map_mat f (mat_of_cols n vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cols n (map (map_vec f) vs) = map_mat f (mat_of_cols n vs)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_of_cols n (map (map_vec f) vs) = map_mat f (mat_of_cols n vs)
[PROOF STEP]
have "\<forall>x\<in>set vs. dim_vec x = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set vs. dim_vec x = n
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
set vs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<forall>x\<in>set vs. dim_vec x = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set vs. dim_vec x = n

goal (1 subgoal):
 1. mat_of_cols n (map (map_vec f) vs) = map_mat f (mat_of_cols n vs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>set vs. dim_vec x = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set vs. dim_vec x = n

goal (1 subgoal):
 1. mat_of_cols n (map (map_vec f) vs) = map_mat f (mat_of_cols n vs)
[PROOF STEP]
by (auto simp add: mat_eq_iff map_vec_def mat_of_cols_def)
[PROOF STATE]
proof (state)
this:
mat_of_cols n (map (map_vec f) vs) = map_mat f (mat_of_cols n vs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cartesian_product_closed':
  assumes "a \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "b \<in>  carrier (R\<^bsup>m\<^esup>)"
  shows "(a@b) \<in>  carrier (R\<^bsup>n + m\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a @ b \<in> carrier (R\<^bsup>n + m\<^esup>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a @ b \<in> carrier (R\<^bsup>n + m\<^esup>)
[PROOF STEP]
have "a@b \<in> cartesian_product {a} {b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a @ b \<in> cartesian_product {a} {b}
[PROOF STEP]
using cartesian_product_def
[PROOF STATE]
proof (prove)
using this:
cartesian_product ?A ?B \<equiv> {xs. \<exists>as\<in>?A. \<exists>bs\<in>?B. xs = as @ bs}

goal (1 subgoal):
 1. a @ b \<in> cartesian_product {a} {b}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a @ b \<in> cartesian_product {a} {b}

goal (1 subgoal):
 1. a @ b \<in> carrier (R\<^bsup>n + m\<^esup>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a @ b \<in> cartesian_product {a} {b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a @ b \<in> cartesian_product {a} {b}

goal (1 subgoal):
 1. a @ b \<in> carrier (R\<^bsup>n + m\<^esup>)
[PROOF STEP]
using cartesian_product_closed[of "{a}" R n "{b}" m]
        assms
[PROOF STATE]
proof (prove)
using this:
a @ b \<in> cartesian_product {a} {b}
\<lbrakk>{a} \<subseteq> carrier (R\<^bsup>n\<^esup>); {b} \<subseteq> carrier (R\<^bsup>m\<^esup>)\<rbrakk> \<Longrightarrow> cartesian_product {a} {b} \<subseteq> carrier (R\<^bsup>n + m\<^esup>)
a \<in> carrier (R\<^bsup>n\<^esup>)
b \<in> carrier (R\<^bsup>m\<^esup>)

goal (1 subgoal):
 1. a @ b \<in> carrier (R\<^bsup>n + m\<^esup>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a @ b \<in> carrier (R\<^bsup>n + m\<^esup>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ennreal_of_enat_1[simp]: "ennreal_of_enat 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal_of_enat 1 = 1
[PROOF STEP]
using ennreal_of_enat_enat[of 1]
[PROOF STATE]
proof (prove)
using this:
ennreal_of_enat (enat 1) = of_nat 1

goal (1 subgoal):
 1. ennreal_of_enat 1 = 1
[PROOF STEP]
unfolding enat_1
[PROOF STATE]
proof (prove)
using this:
ennreal_of_enat 1 = of_nat 1

goal (1 subgoal):
 1. ennreal_of_enat 1 = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma total_eval_const:
  assumes "k \<in> carrier R"
  shows "total_eval R g (indexed_const k) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. total_eval R g (indexed_const k) = k
[PROOF STEP]
unfolding total_eval_def eval_in_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_eval R UNIV g (indexed_const k) {#} = k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<in> carrier R

goal (1 subgoal):
 1. poly_eval R UNIV g (indexed_const k) {#} = k
[PROOF STEP]
by (metis indexed_const_def poly_eval_constant)


[STATEMENT]
lemma (in vectorspace) gen_ge_dim:
  fixes A
  assumes fa: "finite A" and c: "A\<subseteq>carrier V" and l: "gen_set A"
  shows "card A \<ge> dim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim \<le> card A
[PROOF STEP]
proof  -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim \<le> card A
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<subseteq> carrier V
gen_set A
[PROOF STEP]
have fd: "fin_dim"
[PROOF STATE]
proof (prove)
using this:
finite A
A \<subseteq> carrier V
gen_set A

goal (1 subgoal):
 1. fin_dim
[PROOF STEP]
by (unfold fin_dim_def, auto)
[PROOF STATE]
proof (state)
this:
fin_dim

goal (1 subgoal):
 1. dim \<le> card A
[PROOF STEP]
from fd
[PROOF STATE]
proof (chain)
picking this:
fin_dim
[PROOF STEP]
obtain \<beta> where 1: "finite \<beta> \<and> basis \<beta>"
[PROOF STATE]
proof (prove)
using this:
fin_dim

goal (1 subgoal):
 1. (\<And>\<beta>. finite \<beta> \<and> basis \<beta> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis finite_basis_exists)
[PROOF STATE]
proof (state)
this:
finite \<beta> \<and> basis \<beta>

goal (1 subgoal):
 1. dim \<le> card A
[PROOF STEP]
from assms 1
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<subseteq> carrier V
gen_set A
finite \<beta> \<and> basis \<beta>
[PROOF STEP]
have 2: "card A \<ge> card \<beta>"
[PROOF STATE]
proof (prove)
using this:
finite A
A \<subseteq> carrier V
gen_set A
finite \<beta> \<and> basis \<beta>

goal (1 subgoal):
 1. card \<beta> \<le> card A
[PROOF STEP]
apply (intro li_smaller_than_gen, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>finite A; A \<subseteq> carrier V; gen_set A; x \<in> \<beta>; finite \<beta>; basis \<beta>\<rbrakk> \<Longrightarrow> x \<in> carrier V
 2. \<lbrakk>finite A; A \<subseteq> carrier V; gen_set A; finite \<beta>; basis \<beta>; lin_dep \<beta>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (unfold basis_def, auto)
[PROOF STATE]
proof (state)
this:
card \<beta> \<le> card A

goal (1 subgoal):
 1. dim \<le> card A
[PROOF STEP]
from assms 1
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<subseteq> carrier V
gen_set A
finite \<beta> \<and> basis \<beta>
[PROOF STEP]
have 3: "dim = card \<beta>"
[PROOF STATE]
proof (prove)
using this:
finite A
A \<subseteq> carrier V
gen_set A
finite \<beta> \<and> basis \<beta>

goal (1 subgoal):
 1. dim = card \<beta>
[PROOF STEP]
by (intro dim_basis, auto)
[PROOF STATE]
proof (state)
this:
dim = card \<beta>

goal (1 subgoal):
 1. dim \<le> card A
[PROOF STEP]
from 2 3
[PROOF STATE]
proof (chain)
picking this:
card \<beta> \<le> card A
dim = card \<beta>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card \<beta> \<le> card A
dim = card \<beta>

goal (1 subgoal):
 1. dim \<le> card A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim \<le> card A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma overpower_lemma:
  fixes f g :: "real \<Rightarrow> real"
  assumes "f a \<le> g a"
  assumes "\<And>x. a \<le> x \<Longrightarrow> ((\<lambda>x. g x - f x) has_real_derivative (d x)) (at x)"
  assumes "\<And>x. a \<le> x \<Longrightarrow> d x \<ge> 0"
  assumes "a \<le> x"
  shows   "f x \<le> g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<le> g x
[PROOF STEP]
proof (cases "a < x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a < x \<Longrightarrow> f x \<le> g x
 2. \<not> a < x \<Longrightarrow> f x \<le> g x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a < x

goal (2 subgoals):
 1. a < x \<Longrightarrow> f x \<le> g x
 2. \<not> a < x \<Longrightarrow> f x \<le> g x
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
f a \<le> g a
a \<le> ?x \<Longrightarrow> ((\<lambda>x. g x - f x) has_real_derivative d ?x) (at ?x)
a \<le> ?x \<Longrightarrow> 0 \<le> d ?x
a \<le> x
a < x
[PROOF STEP]
have "\<exists>z. z > a \<and> z < x \<and> g x - f x - (g a - f a) = (x - a) * d z"
[PROOF STATE]
proof (prove)
using this:
f a \<le> g a
a \<le> ?x \<Longrightarrow> ((\<lambda>x. g x - f x) has_real_derivative d ?x) (at ?x)
a \<le> ?x \<Longrightarrow> 0 \<le> d ?x
a \<le> x
a < x

goal (1 subgoal):
 1. \<exists>z>a. z < x \<and> g x - f x - (g a - f a) = (x - a) * d z
[PROOF STEP]
by (intro MVT2) auto
[PROOF STATE]
proof (state)
this:
\<exists>z>a. z < x \<and> g x - f x - (g a - f a) = (x - a) * d z

goal (2 subgoals):
 1. a < x \<Longrightarrow> f x \<le> g x
 2. \<not> a < x \<Longrightarrow> f x \<le> g x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>z>a. z < x \<and> g x - f x - (g a - f a) = (x - a) * d z
[PROOF STEP]
obtain z where z: "z > a" "z < x" "g x - f x - (g a - f a) = (x - a) * d z"
[PROOF STATE]
proof (prove)
using this:
\<exists>z>a. z < x \<and> g x - f x - (g a - f a) = (x - a) * d z

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>a < z; z < x; g x - f x - (g a - f a) = (x - a) * d z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a < z
z < x
g x - f x - (g a - f a) = (x - a) * d z

goal (2 subgoals):
 1. a < x \<Longrightarrow> f x \<le> g x
 2. \<not> a < x \<Longrightarrow> f x \<le> g x
[PROOF STEP]
hence "f x = g x + (f a - g a) + (a - x) * d z"
[PROOF STATE]
proof (prove)
using this:
a < z
z < x
g x - f x - (g a - f a) = (x - a) * d z

goal (1 subgoal):
 1. f x = g x + (f a - g a) + (a - x) * d z
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
f x = g x + (f a - g a) + (a - x) * d z

goal (2 subgoals):
 1. a < x \<Longrightarrow> f x \<le> g x
 2. \<not> a < x \<Longrightarrow> f x \<le> g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f x = g x + (f a - g a) + (a - x) * d z

goal (2 subgoals):
 1. a < x \<Longrightarrow> f x \<le> g x
 2. \<not> a < x \<Longrightarrow> f x \<le> g x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f a \<le> g a
a \<le> ?x \<Longrightarrow> ((\<lambda>x. g x - f x) has_real_derivative d ?x) (at ?x)
a \<le> ?x \<Longrightarrow> 0 \<le> d ?x
a \<le> x
[PROOF STEP]
have "f a - g a \<le> 0"
[PROOF STATE]
proof (prove)
using this:
f a \<le> g a
a \<le> ?x \<Longrightarrow> ((\<lambda>x. g x - f x) has_real_derivative d ?x) (at ?x)
a \<le> ?x \<Longrightarrow> 0 \<le> d ?x
a \<le> x

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

goal (2 subgoals):
 1. a < x \<Longrightarrow> f x \<le> g x
 2. \<not> a < x \<Longrightarrow> f x \<le> g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f a - g a \<le> 0

goal (2 subgoals):
 1. a < x \<Longrightarrow> f x \<le> g x
 2. \<not> a < x \<Longrightarrow> f x \<le> g x
[PROOF STEP]
from assms z
[PROOF STATE]
proof (chain)
picking this:
f a \<le> g a
a \<le> ?x \<Longrightarrow> ((\<lambda>x. g x - f x) has_real_derivative d ?x) (at ?x)
a \<le> ?x \<Longrightarrow> 0 \<le> d ?x
a \<le> x
a < z
z < x
g x - f x - (g a - f a) = (x - a) * d z
[PROOF STEP]
have "(a - x) * d z \<le> 0 * d z"
[PROOF STATE]
proof (prove)
using this:
f a \<le> g a
a \<le> ?x \<Longrightarrow> ((\<lambda>x. g x - f x) has_real_derivative d ?x) (at ?x)
a \<le> ?x \<Longrightarrow> 0 \<le> d ?x
a \<le> x
a < z
z < x
g x - f x - (g a - f a) = (x - a) * d z

goal (1 subgoal):
 1. (a - x) * d z \<le> 0 * d z
[PROOF STEP]
by (intro mult_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
(a - x) * d z \<le> 0 * d z

goal (2 subgoals):
 1. a < x \<Longrightarrow> f x \<le> g x
 2. \<not> a < x \<Longrightarrow> f x \<le> g x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>xa y. xa \<le> y \<Longrightarrow> g x + xa + (a - x) * d z \<le> g x + y + (a - x) * d z; \<And>xa y. xa \<le> y \<Longrightarrow> g x + 0 + xa \<le> g x + 0 + y\<rbrakk> \<Longrightarrow> f x \<le> g x + 0 + 0 * d z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>xa y. xa \<le> y \<Longrightarrow> g x + xa + (a - x) * d z \<le> g x + y + (a - x) * d z; \<And>xa y. xa \<le> y \<Longrightarrow> g x + 0 + xa \<le> g x + 0 + y\<rbrakk> \<Longrightarrow> f x \<le> g x + 0 + 0 * d z

goal (1 subgoal):
 1. f x \<le> g x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f x \<le> g x

goal (1 subgoal):
 1. \<not> a < x \<Longrightarrow> f x \<le> g x
[PROOF STEP]
qed (insert assms, auto)


[STATEMENT]
lemma pref_more_expensive:
  assumes "i \<in> agents"
  assumes "x \<in> arg_max_set U[i] (budget_constraint (calculate_value P) consumption_set (P \<bullet> \<E>[i]))"
  assumes "U[i] y > U[i] x"
  shows "y \<bullet> P > P \<bullet> \<E>[i]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<bullet> \<E>[i] < y \<bullet> P
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> P \<bullet> \<E>[i] < y \<bullet> P \<Longrightarrow> False
[PROOF STEP]
assume cpos :  "\<not>(y \<bullet> P > P \<bullet> \<E>[i])"
[PROOF STATE]
proof (state)
this:
\<not> P \<bullet> \<E>[i] < y \<bullet> P

goal (1 subgoal):
 1. \<not> P \<bullet> \<E>[i] < y \<bullet> P \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> P \<bullet> \<E>[i] < y \<bullet> P
[PROOF STEP]
have xp_leq : "y \<bullet> P \<le> P \<bullet>  \<E>[i]"
[PROOF STATE]
proof (prove)
using this:
\<not> P \<bullet> \<E>[i] < y \<bullet> P

goal (1 subgoal):
 1. y \<bullet> P \<le> P \<bullet> \<E>[i]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<bullet> P \<le> P \<bullet> \<E>[i]

goal (1 subgoal):
 1. \<not> P \<bullet> \<E>[i] < y \<bullet> P \<Longrightarrow> False
[PROOF STEP]
hence "x \<in> budget_constraint (calculate_value P) consumption_set (P \<bullet> \<E>[i])"
[PROOF STATE]
proof (prove)
using this:
y \<bullet> P \<le> P \<bullet> \<E>[i]

goal (1 subgoal):
 1. x \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
[PROOF STEP]
using argmax_sol_in_s[of x " U[i]" "budget_constraint (calculate_value P) consumption_set (P \<bullet> \<E>[i])"]
      assms
[PROOF STATE]
proof (prove)
using this:
y \<bullet> P \<le> P \<bullet> \<E>[i]
x \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])) \<Longrightarrow> x \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
i \<in> agents
x \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]))
U[i] x < U[i] y

goal (1 subgoal):
 1. x \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])

goal (1 subgoal):
 1. \<not> P \<bullet> \<E>[i] < y \<bullet> P \<Longrightarrow> False
[PROOF STEP]
hence xp_in: "y \<in> budget_constraint (calculate_value P) consumption_set (P \<bullet> \<E>[i])"
[PROOF STATE]
proof (prove)
using this:
x \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])

goal (1 subgoal):
 1. y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]) \<Longrightarrow> y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
[PROOF STEP]
have "P \<bullet> y \<le> P \<bullet> \<E>[i]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<bullet> y \<le> P \<bullet> \<E>[i]
[PROOF STEP]
by (metis xp_leq inner_commute)
[PROOF STATE]
proof (state)
this:
P \<bullet> y \<le> P \<bullet> \<E>[i]

goal (1 subgoal):
 1. x \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]) \<Longrightarrow> y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P \<bullet> y \<le> P \<bullet> \<E>[i]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P \<bullet> y \<le> P \<bullet> \<E>[i]

goal (1 subgoal):
 1. y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
[PROOF STEP]
using consumption_set_member
[PROOF STATE]
proof (prove)
using this:
P \<bullet> y \<le> P \<bullet> \<E>[i]
\<forall>x. x \<in> consumption_set

goal (1 subgoal):
 1. y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
[PROOF STEP]
by (simp add: budget_constraint_def)
[PROOF STATE]
proof (state)
this:
y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])

goal (1 subgoal):
 1. \<not> P \<bullet> \<E>[i] < y \<bullet> P \<Longrightarrow> False
[PROOF STEP]
hence "y \<succ>[Pref i] x"
[PROOF STATE]
proof (prove)
using this:
y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])

goal (1 subgoal):
 1. y \<succeq>[Pr[i]] x \<and> (x, y) \<notin> Pr[i]
[PROOF STEP]
using arg_max_set_therefore_no_better assms
[PROOF STATE]
proof (prove)
using this:
y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
\<lbrakk>?i \<in> agents; ?x \<in> arg_max_set U[?i] (budget_constraint ((\<bullet>) ?P) consumption_set (?P \<bullet> \<E>[?i]))\<rbrakk> \<Longrightarrow> U[?i] ?x < U[?i] ?y \<longrightarrow> ?y \<notin> budget_constraint ((\<bullet>) ?P) consumption_set (?P \<bullet> \<E>[?i])
i \<in> agents
x \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]))
U[i] x < U[i] y

goal (1 subgoal):
 1. y \<succeq>[Pr[i]] x \<and> (x, y) \<notin> Pr[i]
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<succeq>[Pr[i]] x \<and> (x, y) \<notin> Pr[i]

goal (1 subgoal):
 1. \<not> P \<bullet> \<E>[i] < y \<bullet> P \<Longrightarrow> False
[PROOF STEP]
hence "y \<succ>[Pref i] x \<and> y \<in> budget_constraint (calculate_value P) consumption_set (P \<bullet> \<E>[i])"
[PROOF STATE]
proof (prove)
using this:
y \<succeq>[Pr[i]] x \<and> (x, y) \<notin> Pr[i]

goal (1 subgoal):
 1. (y \<succeq>[Pr[i]] x \<and> (x, y) \<notin> Pr[i]) \<and> y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
[PROOF STEP]
using xp_in
[PROOF STATE]
proof (prove)
using this:
y \<succeq>[Pr[i]] x \<and> (x, y) \<notin> Pr[i]
y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])

goal (1 subgoal):
 1. (y \<succeq>[Pr[i]] x \<and> (x, y) \<notin> Pr[i]) \<and> y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(y \<succeq>[Pr[i]] x \<and> (x, y) \<notin> Pr[i]) \<and> y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])

goal (1 subgoal):
 1. \<not> P \<bullet> \<E>[i] < y \<bullet> P \<Longrightarrow> False
[PROOF STEP]
hence "x \<notin> arg_max_set U[i] (budget_constraint (calculate_value P) consumption_set (P \<bullet> \<E>[i]))"
[PROOF STATE]
proof (prove)
using this:
(y \<succeq>[Pr[i]] x \<and> (x, y) \<notin> Pr[i]) \<and> y \<in> budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i])

goal (1 subgoal):
 1. x \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]))
[PROOF STEP]
by (meson assms exchange_economy.arg_max_set_therefore_no_better
        exchange_economy_axioms)
[PROOF STATE]
proof (state)
this:
x \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]))

goal (1 subgoal):
 1. \<not> P \<bullet> \<E>[i] < y \<bullet> P \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]))
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
x \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]))

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
x \<notin> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]))
x \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (P \<bullet> \<E>[i]))

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<lbrakk> x3 = \<bar>x2\<bar> - x1; x4 = \<bar>x3\<bar> - x2; x5 = \<bar>x4\<bar> - x3;
         x6 = \<bar>x5\<bar> - x4; x7 = \<bar>x6\<bar> - x5; x8 = \<bar>x7\<bar> - x6;
         x9 = \<bar>x8\<bar> - x7; x10 = \<bar>x9\<bar> - x8; x11 = \<bar>x10\<bar> - x9 \<rbrakk>
 \<Longrightarrow> x1 = x10 \<and> x2 = (x11::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x3 = \<bar>x2\<bar> - x1; x4 = \<bar>x3\<bar> - x2; x5 = \<bar>x4\<bar> - x3; x6 = \<bar>x5\<bar> - x4; x7 = \<bar>x6\<bar> - x5; x8 = \<bar>x7\<bar> - x6; x9 = \<bar>x8\<bar> - x7; x10 = \<bar>x9\<bar> - x8; x11 = \<bar>x10\<bar> - x9\<rbrakk> \<Longrightarrow> x1 = x10 \<and> x2 = x11
[PROOF STEP]
by (smt (verit))


[STATEMENT]
lemma mult_mono_nonneg_nonpos:
  "c \<le> a \<Longrightarrow> b \<le> d \<Longrightarrow> a \<ge> 0 \<Longrightarrow> d \<le> 0 \<Longrightarrow> a * b \<le> c * (d :: 'a :: {comm_ring, linordered_ring})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c \<le> a; b \<le> d; (0::'a) \<le> a; d \<le> (0::'a)\<rbrakk> \<Longrightarrow> a * b \<le> c * d
[PROOF STEP]
using mult_mono[of c a "-d" "-b"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>c \<le> a; - d \<le> - b; (0::'a) \<le> a; (0::'a) \<le> - d\<rbrakk> \<Longrightarrow> c * - d \<le> a * - b

goal (1 subgoal):
 1. \<lbrakk>c \<le> a; b \<le> d; (0::'a) \<le> a; d \<le> (0::'a)\<rbrakk> \<Longrightarrow> a * b \<le> c * d
[PROOF STEP]
by (simp add: mult.commute)


[STATEMENT]
lemma derived_set_of_infinite_openin:
   "Hausdorff_space X
        \<Longrightarrow> X derived_set_of S =
            {x \<in> topspace X. \<forall>U. x \<in> U \<and> openin X U \<longrightarrow> infinite(S \<inter> U)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hausdorff_space X \<Longrightarrow> X derived_set_of S = {x \<in> topspace X. \<forall>U. x \<in> U \<and> openin X U \<longrightarrow> infinite (S \<inter> U)}
[PROOF STEP]
using Hausdorff_imp_t1_space t1_space_derived_set_of_infinite_openin
[PROOF STATE]
proof (prove)
using this:
Hausdorff_space ?X \<Longrightarrow> t1_space ?X
t1_space ?X = (\<forall>S. ?X derived_set_of S = {x \<in> topspace ?X. \<forall>U. x \<in> U \<and> openin ?X U \<longrightarrow> infinite (S \<inter> U)})

goal (1 subgoal):
 1. Hausdorff_space X \<Longrightarrow> X derived_set_of S = {x \<in> topspace X. \<forall>U. x \<in> U \<and> openin X U \<longrightarrow> infinite (S \<inter> U)}
[PROOF STEP]
by fastforce


[STATEMENT]
theorem ln_upper_3: "0<x \<Longrightarrow> ln(x) \<le> ln_upper_3 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ln x \<le> ln_upper_3 x
[PROOF STEP]
by (metis le_less_linear less_eq_real_def ln_upper_3_neg ln_upper_3_pos)


[STATEMENT]
lemma lin_bound_argument2:
  fixes A :: "('a :: {field}) mat"
  assumes "distinct (cols A)"
  assumes "A \<in> carrier_mat nr nc"
  assumes "\<And> f. vec nr (\<lambda>i. \<Sum> j \<in> {0..<nc} . f (col A j) * (col A j) $ i) = 0\<^sub>v nr \<Longrightarrow>
    \<forall>v\<in> (set (cols A)). f v = 0"
  shows "nc \<le> nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nc \<le> nr
[PROOF STEP]
proof (intro lin_bound_argument[of A nr nc], simp add: assms, simp add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = 0\<^sub>v nr \<Longrightarrow> \<forall>v\<in>set (cols A). f v = (0::'a)
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = 0\<^sub>v nr \<Longrightarrow> \<forall>v\<in>set (cols A). f v = (0::'a)
[PROOF STEP]
have "A *\<^sub>v vec nc (\<lambda>i. f (col A i)) =
      vec (dim_row A) (\<lambda>i. \<Sum> j \<in> {0..<nc} . (row A i $ j) * f (col A j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. row A i $ j * f (col A j))
[PROOF STEP]
by (auto simp add: mult_mat_vec_def scalar_prod_def assms(2))
[PROOF STATE]
proof (state)
this:
A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. row A i $ j * f (col A j))

goal (1 subgoal):
 1. \<And>f. A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = 0\<^sub>v nr \<Longrightarrow> \<forall>v\<in>set (cols A). f v = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. row A i $ j * f (col A j))

goal (1 subgoal):
 1. \<And>f. A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = 0\<^sub>v nr \<Longrightarrow> \<forall>v\<in>set (cols A). f v = (0::'a)
[PROOF STEP]
have "... = vec (dim_row A) (\<lambda>i. \<Sum> j \<in> {0..<nc} . f (col A j) * (col A j $ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. row A i $ j * f (col A j)) = vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. f (col A j) * col A j $ i)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. row A i $ j * f (col A j)) = vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. f (col A j) * col A j $ i)
[PROOF STEP]
by (intro eq_vecI, simp_all) (meson mult.commute)
[PROOF STATE]
proof (state)
this:
vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. row A i $ j * f (col A j)) = vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. f (col A j) * col A j $ i)

goal (1 subgoal):
 1. \<And>f. A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = 0\<^sub>v nr \<Longrightarrow> \<forall>v\<in>set (cols A). f v = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. f (col A j) * col A j $ i)
[PROOF STEP]
show "A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = 0\<^sub>v nr \<Longrightarrow> \<forall>v\<in>set (cols A). f v = 0"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. f (col A j) * col A j $ i)

goal (1 subgoal):
 1. A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = 0\<^sub>v nr \<Longrightarrow> \<forall>v\<in>set (cols A). f v = (0::'a)
[PROOF STEP]
using assms(3)[of f] assms(2)
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = vec (dim_row A) (\<lambda>i. \<Sum>j = 0..<nc. f (col A j) * col A j $ i)
vec nr (\<lambda>i. \<Sum>j = 0..<nc. f (col A j) * col A j $ i) = 0\<^sub>v nr \<Longrightarrow> \<forall>v\<in>set (cols A). f v = (0::'a)
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = 0\<^sub>v nr \<Longrightarrow> \<forall>v\<in>set (cols A). f v = (0::'a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
A *\<^sub>v vec nc (\<lambda>i. f (col A i)) = 0\<^sub>v nr \<Longrightarrow> \<forall>v\<in>set (cols A). f v = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Set_filter_insert:
  "Set.filter P (insert x A) = (if P x then insert x (Set.filter P A) else Set.filter P A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Set.filter P (insert x A) = (if P x then insert x (Set.filter P A) else Set.filter P A)
[PROOF STEP]
by (auto simp: Set.filter_def)


[STATEMENT]
lemma (in prob_space) indep_vars_def:
  "indep_vars M' X I \<longleftrightarrow>
    (\<forall>i\<in>I. random_variable (M' i) (X i)) \<and>
    indep_sets (\<lambda>i. sigma_sets (space M) { X i -` A \<inter> space M | A. A \<in> sets (M' i)}) I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_vars M' X I = ((\<forall>i\<in>I. random_variable (M' i) (X i)) \<and> indep_sets (\<lambda>i. sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> sets (M' i)}) I)
[PROOF STEP]
unfolding indep_vars_def2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>i\<in>I. random_variable (M' i) (X i)) \<and> indep_sets (\<lambda>i. {X i -` A \<inter> space M |A. A \<in> sets (M' i)}) I) = ((\<forall>i\<in>I. random_variable (M' i) (X i)) \<and> indep_sets (\<lambda>i. sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> sets (M' i)}) I)
[PROOF STEP]
apply (rule conj_cong[OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>I. random_variable (M' i) (X i) \<Longrightarrow> indep_sets (\<lambda>i. {X i -` A \<inter> space M |A. A \<in> sets (M' i)}) I = indep_sets (\<lambda>i. sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> sets (M' i)}) I
[PROOF STEP]
apply (rule indep_sets_sigma_sets_iff[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<forall>i\<in>I. random_variable (M' i) (X i); i \<in> I\<rbrakk> \<Longrightarrow> Int_stable {X i -` A \<inter> space M |A. A \<in> sets (M' i)}
[PROOF STEP]
apply (auto simp: Int_stable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i A Aa. \<lbrakk>\<forall>i\<in>I. random_variable (M' i) (X i); i \<in> I; A \<in> sets (M' i); Aa \<in> sets (M' i)\<rbrakk> \<Longrightarrow> \<exists>Ab. X i -` A \<inter> space M \<inter> (X i -` Aa \<inter> space M) = X i -` Ab \<inter> space M \<and> Ab \<in> sets (M' i)
[PROOF STEP]
apply (rule_tac x="A \<inter> Aa" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i A Aa. \<lbrakk>\<forall>i\<in>I. random_variable (M' i) (X i); i \<in> I; A \<in> sets (M' i); Aa \<in> sets (M' i)\<rbrakk> \<Longrightarrow> X i -` A \<inter> space M \<inter> (X i -` Aa \<inter> space M) = X i -` (A \<inter> Aa) \<inter> space M \<and> A \<inter> Aa \<in> sets (M' i)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma x_power_minus_1:
  fixes x :: "'a :: {ab_group_add, power, numeral, one}"
  shows "x + (2::'a) ^ n - (1::'a) = x + (2 ^ n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + (2::'a) ^ n - (1::'a) = x + ((2::'a) ^ n - (1::'a))
[PROOF STEP]
by simp


[STATEMENT]
theorem factorization_unique:
  "\<forall>p\<in>#M. prime p \<Longrightarrow> \<forall>p\<in>#N. prime p \<Longrightarrow> (\<Prod>i\<in>#M. i) = (\<Prod>i\<in>#N. i) \<Longrightarrow> M = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>p\<in>#M. prime p; \<forall>p\<in>#N. prime p; (\<Prod>i\<in>#M. i) = (\<Prod>i\<in>#N. i)\<rbrakk> \<Longrightarrow> M = N
[PROOF STEP]
@proof
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>p\<in>#M. prime p; \<forall>p\<in>#N. prime p; (\<Prod>i\<in>#M. i) = (\<Prod>i\<in>#N. i)\<rbrakk> \<Longrightarrow> M = N
[PROOF STEP]
@have "M \<subseteq># N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>p\<in>#M. prime p; \<forall>p\<in>#N. prime p; (\<Prod>i\<in>#M. i) = (\<Prod>i\<in>#N. i)\<rbrakk> \<Longrightarrow> M = N
[PROOF STEP]
@qed


[STATEMENT]
lemma is_interval_convex_1:
  fixes S :: "real set"
  shows "is_interval S \<longleftrightarrow> convex S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_interval S = convex S
[PROOF STEP]
by (metis is_interval_convex convex_connected is_interval_connected_1)


[STATEMENT]
lemma "(\<exists>x. F x) \<and> (\<exists>y. G y)
    \<longrightarrow> ( ((\<forall>x. F x \<longrightarrow> H x) \<and> (\<forall>y. G y \<longrightarrow> J y))  =
          (\<forall>x y. F x \<and> G y \<longrightarrow> H x \<and> J y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. F x) \<and> (\<exists>y. G y) \<longrightarrow> ((\<forall>x. F x \<longrightarrow> H x) \<and> (\<forall>y. G y \<longrightarrow> J y)) = (\<forall>x y. F x \<and> G y \<longrightarrow> H x \<and> J y)
[PROOF STEP]
by blast


[STATEMENT]
lemma intersect_list_nodes_card:
    assumes "list_all (finite \<circ> DBA.nodes) AA"
    shows "card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)
[PROOF STEP]
have "card (DBA.nodes (intersect_list AA)) \<le>
      max 1 (length (dgba.accepting (intersect_list' AA))) * card (DGBA.nodes (intersect_list' AA))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (DBA.nodes (intersect_list AA)) \<le> max 1 (length (dgba.accepting (intersect_list' AA))) * card (DGBA.nodes (intersect_list' AA))
[PROOF STEP]
using degeneralize_nodes_card
[PROOF STATE]
proof (prove)
using this:
card (DBA.nodes (degeneralize ?A)) \<le> max 1 (length (dgba.accepting ?A)) * card (DGBA.nodes ?A)

goal (1 subgoal):
 1. card (DBA.nodes (intersect_list AA)) \<le> max 1 (length (dgba.accepting (intersect_list' AA))) * card (DGBA.nodes (intersect_list' AA))
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
card (DBA.nodes (intersect_list AA)) \<le> max 1 (length (dgba.accepting (intersect_list' AA))) * card (DGBA.nodes (intersect_list' AA))

goal (1 subgoal):
 1. card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (DBA.nodes (intersect_list AA)) \<le> max 1 (length (dgba.accepting (intersect_list' AA))) * card (DGBA.nodes (intersect_list' AA))

goal (1 subgoal):
 1. card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)
[PROOF STEP]
have "length (dgba.accepting (intersect_list' AA)) = length AA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (dgba.accepting (intersect_list' AA)) = length AA
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (dgba.accepting (intersect_list' AA)) = length AA

goal (1 subgoal):
 1. card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (dgba.accepting (intersect_list' AA)) = length AA

goal (1 subgoal):
 1. card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)
[PROOF STEP]
have "card (DGBA.nodes (intersect_list' AA)) \<le> prod_list (map (card \<circ> DBA.nodes) AA)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (DGBA.nodes (intersect_list' AA)) \<le> prod_list (map (card \<circ> DBA.nodes) AA)
[PROOF STEP]
using intersect_list'_nodes_card assms
[PROOF STATE]
proof (prove)
using this:
list_all (finite \<circ> DBA.nodes) ?AA \<Longrightarrow> card (DGBA.nodes (intersect_list' ?AA)) \<le> prod_list (map (card \<circ> DBA.nodes) ?AA)
list_all (finite \<circ> DBA.nodes) AA

goal (1 subgoal):
 1. card (DGBA.nodes (intersect_list' AA)) \<le> prod_list (map (card \<circ> DBA.nodes) AA)
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
card (DGBA.nodes (intersect_list' AA)) \<le> prod_list (map (card \<circ> DBA.nodes) AA)

goal (1 subgoal):
 1. card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> max 1 (length AA) * x \<le> max 1 (length AA) * y) \<Longrightarrow> card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> max 1 (length AA) * x \<le> max 1 (length AA) * y) \<Longrightarrow> card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)

goal (1 subgoal):
 1. card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (DBA.nodes (intersect_list AA)) \<le> max 1 (length AA) * prod_list (map (card \<circ> DBA.nodes) AA)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "((\<lambda>(x, y). (x::real , - y::real)) has_derivative (\<lambda>h. (fst h, - snd h))) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>(x, y). (x, - y)) has_derivative (\<lambda>h. (fst h, - snd h))) (at x)
[PROOF STEP]
apply (rule has_derivative_eq_rhs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ((\<lambda>(x, y). (x, - y)) has_derivative ?f') (at x)
 2. ?f' = (\<lambda>h. (fst h, - snd h))
[PROOF STEP]
apply (rule has_derivative_split)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ((\<lambda>p. (fst p, - snd p)) has_derivative ?f') (at x)
 2. ?f' = (\<lambda>h. (fst h, - snd h))
[PROOF STEP]
apply (rule has_derivative_Pair)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (fst has_derivative ?f'5) (at x)
 2. ((\<lambda>x. - snd x) has_derivative ?g'5) (at x)
 3. (\<lambda>h. (?f'5 h, ?g'5 h)) = (\<lambda>h. (fst h, - snd h))
[PROOF STEP]
by (auto intro!: derivative_eq_intros)


[STATEMENT]
lemma contour_integral_subcontour_integral:
  assumes "f contour_integrable_on g" "valid_path g" "u \<in> {0..1}" "v \<in> {0..1}" "u \<le> v"
    shows "contour_integral (subpath u v g) f =
           integral {u..v} (\<lambda>x. f(g x) * vector_derivative g (at x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (subpath u v g) f = integral {u..v} (\<lambda>x. f (g x) * vector_derivative g (at x))
[PROOF STEP]
using assms has_contour_integral_subpath contour_integral_unique
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on g
valid_path g
u \<in> {0..1}
v \<in> {0..1}
u \<le> v
\<lbrakk>?f contour_integrable_on ?g; valid_path ?g; ?u \<in> {0..1}; ?v \<in> {0..1}; ?u \<le> ?v\<rbrakk> \<Longrightarrow> (?f has_contour_integral integral {?u..?v} (\<lambda>x. ?f (?g x) * vector_derivative ?g (at x))) (subpath ?u ?v ?g)
(?f has_contour_integral ?i) ?g \<Longrightarrow> contour_integral ?g ?f = ?i

goal (1 subgoal):
 1. contour_integral (subpath u v g) f = integral {u..v} (\<lambda>x. f (g x) * vector_derivative g (at x))
[PROOF STEP]
by blast


[STATEMENT]
theorem raabes_test_divergence:
fixes f :: "nat \<Rightarrow> real"
  assumes pos: "eventually (\<lambda>n. f n > 0) sequentially"
  defines "l \<equiv> limsup (\<lambda>n. ereal (of_nat n * (f n / f (Suc n) - 1)))"
  assumes l: "l < 1"
  shows   "\<not>summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> summable f
[PROOF STEP]
proof (rule kummers_test_divergence)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 < ?p n
 3. \<not> summable (\<lambda>n. inverse (?p n))
 4. limsup (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n))) < 0
[PROOF STEP]
let ?l' = "limsup (\<lambda>n. ereal (of_nat n * f n / f (Suc n) - of_nat (Suc n)))"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 < ?p n
 3. \<not> summable (\<lambda>n. inverse (?p n))
 4. limsup (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n))) < 0
[PROOF STEP]
note l
[PROOF STATE]
proof (state)
this:
l < 1

goal (4 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 < ?p n
 3. \<not> summable (\<lambda>n. inverse (?p n))
 4. limsup (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n))) < 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
l < 1

goal (4 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 < ?p n
 3. \<not> summable (\<lambda>n. inverse (?p n))
 4. limsup (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n))) < 0
[PROOF STEP]
have "l = limsup (\<lambda>n. ereal (of_nat n * f n / f (Suc n) - of_nat (Suc n)) + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l = limsup (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)) + 1)
[PROOF STEP]
by (simp add: l_def algebra_simps)
[PROOF STATE]
proof (state)
this:
l = limsup (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)) + 1)

goal (4 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 < ?p n
 3. \<not> summable (\<lambda>n. inverse (?p n))
 4. limsup (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n))) < 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
l = limsup (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)) + 1)

goal (4 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 < ?p n
 3. \<not> summable (\<lambda>n. inverse (?p n))
 4. limsup (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n))) < 0
[PROOF STEP]
have "\<dots> = ?l' + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)) + 1) = limsup (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n))) + 1
[PROOF STEP]
by (subst Limsup_add_ereal_right) simp_all
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n)) + 1) = limsup (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n))) + 1

goal (4 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 < ?p n
 3. \<not> summable (\<lambda>n. inverse (?p n))
 4. limsup (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n))) < 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
limsup (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n))) + 1 < 1
[PROOF STEP]
show "?l' < 0"
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n))) + 1 < 1

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n))) < 0
[PROOF STEP]
by (cases ?l') (simp_all add: algebra_simps)
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. ereal (real n * f n / f (Suc n) - real (Suc n))) < 0

goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 < f n
 2. \<forall>\<^sub>F n in sequentially. 0 < real n
 3. \<not> summable (\<lambda>n. inverse (real n))
[PROOF STEP]
qed (insert pos eventually_gt_at_top[of "0::nat"] not_summable_harmonic, simp_all)


[STATEMENT]
lemma pythagoras_verbose:
  "((A1::real) - B1) * (C1 - B1) + (A2 - B2) * (C2 - B2) = 0 \<Longrightarrow>
  (C1 - A1) * (C1 - A1) + (C2 - A2) * (C2 - A2) =
  ((B1 - A1) * (B1 - A1) + (B2 - A2) * (B2 - A2)) + (C1 - B1) * (C1 - B1) + (C2 - B2) * (C2 - B2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A1 - B1) * (C1 - B1) + (A2 - B2) * (C2 - B2) = 0 \<Longrightarrow> (C1 - A1) * (C1 - A1) + (C2 - A2) * (C2 - A2) = (B1 - A1) * (B1 - A1) + (B2 - A2) * (B2 - A2) + (C1 - B1) * (C1 - B1) + (C2 - B2) * (C2 - B2)
[PROOF STEP]
by algebra


[STATEMENT]
lemma hExp_add: "\<And>a b. hExp (a + b) = hExp a * hExp b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. hExp (a + b) = hExp a * hExp b
[PROOF STEP]
by transfer (rule exp_add)


[STATEMENT]
lemma infsum_superconst_infinite_ennreal:
  fixes f :: \<open>'a \<Rightarrow> ennreal\<close>
  assumes \<open>\<And>x. x \<in> S \<Longrightarrow> f x \<ge> b\<close>
  assumes \<open>b > 0\<close>
  assumes \<open>infinite S\<close>
  shows "infsum f S = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsum f S = \<infinity>
[PROOF STEP]
using assms infsumI has_sum_superconst_infinite_ennreal
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> b \<le> f ?x
0 < b
infinite S
has_sum ?f ?A ?x \<Longrightarrow> infsum ?f ?A = ?x
\<lbrakk>\<And>x. x \<in> ?S \<Longrightarrow> ?b \<le> ?f x; 0 < ?b; infinite ?S\<rbrakk> \<Longrightarrow> has_sum ?f ?S \<infinity>

goal (1 subgoal):
 1. infsum f S = \<infinity>
[PROOF STEP]
by blast


[STATEMENT]
lemma sin_cos_eq: "sin x = cos (of_real pi/2 - x)"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin x = cos (of_real pi / (2::'a) - x)
[PROOF STEP]
by (simp add: cos_diff)


[STATEMENT]
lemma tendsto_obtains_N:
  assumes "f \<longlonglongrightarrow> f0"
  assumes "open S"
    and "f0 \<in> S"
  obtains N where "\<forall>n\<ge>N. f n \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. f n \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<longlonglongrightarrow> f0
open S
f0 \<in> S

goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. f n \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using tendsto_def
[PROOF STATE]
proof (prove)
using this:
f \<longlonglongrightarrow> f0
open S
f0 \<in> S
(?f \<longlongrightarrow> ?l) ?F = (\<forall>S. open S \<longrightarrow> ?l \<in> S \<longrightarrow> (\<forall>\<^sub>F x in ?F. ?f x \<in> S))

goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. f n \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lim_explicit[of f f0] assms
[PROOF STATE]
proof (prove)
using this:
f \<longlonglongrightarrow> f0
open S
f0 \<in> S
(?f \<longlongrightarrow> ?l) ?F = (\<forall>S. open S \<longrightarrow> ?l \<in> S \<longrightarrow> (\<forall>\<^sub>F x in ?F. ?f x \<in> S))
f \<longlonglongrightarrow> f0 = (\<forall>S. open S \<longrightarrow> f0 \<in> S \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. f n \<in> S))
f \<longlonglongrightarrow> f0
open S
f0 \<in> S

goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. f n \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma DERIV_arccos:
  assumes "- 1 < x" "x < 1"
  shows "DERIV arccos x :> inverse (- sqrt (1 - x\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (arccos has_real_derivative inverse (- sqrt (1 - x\<^sup>2))) (at x)
[PROOF STEP]
proof (rule DERIV_inverse_function)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. (?f has_real_derivative - sqrt (1 - x\<^sup>2)) (at (arccos x))
 2. - sqrt (1 - x\<^sup>2) \<noteq> 0
 3. ?a < x
 4. x < ?b
 5. \<And>y. \<lbrakk>?a < y; y < ?b\<rbrakk> \<Longrightarrow> ?f (arccos y) = y
 6. isCont arccos x
[PROOF STEP]
show "(cos has_real_derivative - sqrt (1 - x\<^sup>2)) (at (arccos x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cos has_real_derivative - sqrt (1 - x\<^sup>2)) (at (arccos x))
[PROOF STEP]
by (rule derivative_eq_intros | use assms sin_arccos in force)+
[PROOF STATE]
proof (state)
this:
(cos has_real_derivative - sqrt (1 - x\<^sup>2)) (at (arccos x))

goal (5 subgoals):
 1. - sqrt (1 - x\<^sup>2) \<noteq> 0
 2. ?a < x
 3. x < ?b
 4. \<And>y. \<lbrakk>?a < y; y < ?b\<rbrakk> \<Longrightarrow> cos (arccos y) = y
 5. isCont arccos x
[PROOF STEP]
show "- sqrt (1 - x\<^sup>2) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - sqrt (1 - x\<^sup>2) \<noteq> 0
[PROOF STEP]
using abs_square_eq_1 assms
[PROOF STATE]
proof (prove)
using this:
(?x\<^sup>2 = (1::?'a)) = (\<bar>?x\<bar> = (1::?'a))
- 1 < x
x < 1

goal (1 subgoal):
 1. - sqrt (1 - x\<^sup>2) \<noteq> 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
- sqrt (1 - x\<^sup>2) \<noteq> 0

goal (4 subgoals):
 1. ?a < x
 2. x < ?b
 3. \<And>y. \<lbrakk>?a < y; y < ?b\<rbrakk> \<Longrightarrow> cos (arccos y) = y
 4. isCont arccos x
[PROOF STEP]
qed (use assms isCont_arccos in auto)


[STATEMENT]
lemma complex_mat_has_unitary_schur_decomposition:
  fixes A :: "complex mat"
  assumes "A \<in> carrier_mat n n"
  shows "\<exists>B P es. similar_mat_wit A B P (adjoint P) \<and> unitary P
    \<and> char_poly A = (\<Prod> (e :: complex) \<leftarrow> es. [:- e, 1:]) \<and> diag_mat B = es"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>B P es. similar_mat_wit A B P (adjoint P) \<and> unitary P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>B P es. similar_mat_wit A B P (adjoint P) \<and> unitary P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es
[PROOF STEP]
have "\<exists>es. char_poly A =  (\<Prod> e \<leftarrow> es. [:- e, 1:]) \<and> length es = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>es. char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> length es = n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. \<exists>es. char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> length es = n
[PROOF STEP]
by (simp add: complex_mat_char_poly_factorizable)
[PROOF STATE]
proof (state)
this:
\<exists>es. char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> length es = n

goal (1 subgoal):
 1. \<exists>B P es. similar_mat_wit A B P (adjoint P) \<and> unitary P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>es. char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> length es = n
[PROOF STEP]
obtain es where es: "char_poly A =  (\<Prod> e \<leftarrow> es. [:- e, 1:]) \<and> length es = n"
[PROOF STATE]
proof (prove)
using this:
\<exists>es. char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> length es = n

goal (1 subgoal):
 1. (\<And>es. char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> length es = n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> length es = n

goal (1 subgoal):
 1. \<exists>B P es. similar_mat_wit A B P (adjoint P) \<and> unitary P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es
[PROOF STEP]
obtain B P Q where B: "unitary_schur_decomposition A es = (B,P,Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B P Q. unitary_schur_decomposition A es = (B, P, Q) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "unitary_schur_decomposition A es", auto)
[PROOF STATE]
proof (state)
this:
unitary_schur_decomposition A es = (B, P, Q)

goal (1 subgoal):
 1. \<exists>B P es. similar_mat_wit A B P (adjoint P) \<and> unitary P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es
[PROOF STEP]
have "similar_mat_wit A B P Q \<and> upper_triangular B \<and> unitary P \<and> (Q = adjoint P) \<and>
   char_poly A = (\<Prod> (e :: complex) \<leftarrow> es. [:- e, 1:]) \<and> diag_mat B = es"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat_wit A B P Q \<and> upper_triangular B \<and> unitary P \<and> Q = adjoint P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es
[PROOF STEP]
using assms es B
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> length es = n
unitary_schur_decomposition A es = (B, P, Q)

goal (1 subgoal):
 1. similar_mat_wit A B P Q \<and> upper_triangular B \<and> unitary P \<and> Q = adjoint P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es
[PROOF STEP]
by (auto simp add: unitary_schur_decomposition)
[PROOF STATE]
proof (state)
this:
similar_mat_wit A B P Q \<and> upper_triangular B \<and> unitary P \<and> Q = adjoint P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es

goal (1 subgoal):
 1. \<exists>B P es. similar_mat_wit A B P (adjoint P) \<and> unitary P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
similar_mat_wit A B P Q \<and> upper_triangular B \<and> unitary P \<and> Q = adjoint P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B P Q \<and> upper_triangular B \<and> unitary P \<and> Q = adjoint P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es

goal (1 subgoal):
 1. \<exists>B P es. similar_mat_wit A B P (adjoint P) \<and> unitary P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>B P es. similar_mat_wit A B P (adjoint P) \<and> unitary P \<and> char_poly A = (\<Prod>e\<leftarrow>es. [:- e, 1:]) \<and> diag_mat B = es

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_random_bst:
  assumes "t \<in> set_pmf (random_bst A)" "finite A"
  shows   "set_tree t = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_tree t = A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_tree t = A
[PROOF STEP]
have "random_bst A = map_pmf bst_of_list (pmf_of_set (permutations_of_set A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. random_bst A = map_pmf bst_of_list (pmf_of_set (permutations_of_set A))
[PROOF STEP]
by (rule random_bst_altdef) fact+
[PROOF STATE]
proof (state)
this:
random_bst A = map_pmf bst_of_list (pmf_of_set (permutations_of_set A))

goal (1 subgoal):
 1. set_tree t = A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
random_bst A = map_pmf bst_of_list (pmf_of_set (permutations_of_set A))

goal (1 subgoal):
 1. set_tree t = A
[PROOF STEP]
have "set_pmf \<dots> = bst_of_list ` permutations_of_set A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_pmf (map_pmf bst_of_list (pmf_of_set (permutations_of_set A))) = bst_of_list ` permutations_of_set A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
t \<in> set_pmf (random_bst A)
finite A

goal (1 subgoal):
 1. set_pmf (map_pmf bst_of_list (pmf_of_set (permutations_of_set A))) = bst_of_list ` permutations_of_set A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_pmf (map_pmf bst_of_list (pmf_of_set (permutations_of_set A))) = bst_of_list ` permutations_of_set A

goal (1 subgoal):
 1. set_tree t = A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
set_pmf (random_bst A) = bst_of_list ` permutations_of_set A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set_pmf (random_bst A) = bst_of_list ` permutations_of_set A

goal (1 subgoal):
 1. set_tree t = A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set_pmf (random_bst A) = bst_of_list ` permutations_of_set A
t \<in> set_pmf (random_bst A)
finite A

goal (1 subgoal):
 1. set_tree t = A
[PROOF STEP]
by (auto simp: permutations_of_setD)
[PROOF STATE]
proof (state)
this:
set_tree t = A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fact_approx_upper_add: assumes al: "a \<le> Suc l" shows "fact l * real a ^ n \<le> fact (l + n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact l * real a ^ n \<le> fact (l + n)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fact l * real a ^ 0 \<le> fact (l + 0)
 2. \<And>n. fact l * real a ^ n \<le> fact (l + n) \<Longrightarrow> fact l * real a ^ Suc n \<le> fact (l + Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
fact l * real a ^ n \<le> fact (l + n)

goal (2 subgoals):
 1. fact l * real a ^ 0 \<le> fact (l + 0)
 2. \<And>n. fact l * real a ^ n \<le> fact (l + n) \<Longrightarrow> fact l * real a ^ Suc n \<le> fact (l + Suc n)
[PROOF STEP]
have "fact l * real a ^ (Suc n) = (fact l * real a ^ n) * real a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact l * real a ^ Suc n = fact l * real a ^ n * real a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fact l * real a ^ Suc n = fact l * real a ^ n * real a

goal (2 subgoals):
 1. fact l * real a ^ 0 \<le> fact (l + 0)
 2. \<And>n. fact l * real a ^ n \<le> fact (l + n) \<Longrightarrow> fact l * real a ^ Suc n \<le> fact (l + Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fact l * real a ^ Suc n = fact l * real a ^ n * real a

goal (2 subgoals):
 1. fact l * real a ^ 0 \<le> fact (l + 0)
 2. \<And>n. fact l * real a ^ n \<le> fact (l + n) \<Longrightarrow> fact l * real a ^ Suc n \<le> fact (l + Suc n)
[PROOF STEP]
have "\<dots> \<le> fact (l + n) * real a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact l * real a ^ n * real a \<le> fact (l + n) * real a
[PROOF STEP]
by (rule mult_right_mono[OF Suc], auto)
[PROOF STATE]
proof (state)
this:
fact l * real a ^ n * real a \<le> fact (l + n) * real a

goal (2 subgoals):
 1. fact l * real a ^ 0 \<le> fact (l + 0)
 2. \<And>n. fact l * real a ^ n \<le> fact (l + n) \<Longrightarrow> fact l * real a ^ Suc n \<le> fact (l + Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fact l * real a ^ n * real a \<le> fact (l + n) * real a

goal (2 subgoals):
 1. fact l * real a ^ 0 \<le> fact (l + 0)
 2. \<And>n. fact l * real a ^ n \<le> fact (l + n) \<Longrightarrow> fact l * real a ^ Suc n \<le> fact (l + Suc n)
[PROOF STEP]
have "\<dots> \<le> fact (l + n) * real (Suc (l + n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (l + n) * real a \<le> fact (l + n) * real (Suc (l + n))
[PROOF STEP]
by (intro mult_left_mono, insert al, auto)
[PROOF STATE]
proof (state)
this:
fact (l + n) * real a \<le> fact (l + n) * real (Suc (l + n))

goal (2 subgoals):
 1. fact l * real a ^ 0 \<le> fact (l + 0)
 2. \<And>n. fact l * real a ^ n \<le> fact (l + n) \<Longrightarrow> fact l * real a ^ Suc n \<le> fact (l + Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fact (l + n) * real a \<le> fact (l + n) * real (Suc (l + n))

goal (2 subgoals):
 1. fact l * real a ^ 0 \<le> fact (l + 0)
 2. \<And>n. fact l * real a ^ n \<le> fact (l + n) \<Longrightarrow> fact l * real a ^ Suc n \<le> fact (l + Suc n)
[PROOF STEP]
have "\<dots> = fact (Suc (l + n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (l + n) * real (Suc (l + n)) = fact (Suc (l + n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fact (l + n) * real (Suc (l + n)) = fact (Suc (l + n))

goal (2 subgoals):
 1. fact l * real a ^ 0 \<le> fact (l + 0)
 2. \<And>n. fact l * real a ^ n \<le> fact (l + n) \<Longrightarrow> fact l * real a ^ Suc n \<le> fact (l + Suc n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fact l * real a ^ Suc n \<le> fact (Suc (l + n))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fact l * real a ^ Suc n \<le> fact (Suc (l + n))

goal (1 subgoal):
 1. fact l * real a ^ Suc n \<le> fact (l + Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fact l * real a ^ Suc n \<le> fact (l + Suc n)

goal (1 subgoal):
 1. fact l * real a ^ 0 \<le> fact (l + 0)
[PROOF STEP]
qed simp


[STATEMENT]
lemma hausdorff_distance_closure [simp]:
  "hausdorff_distance A (closure A) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hausdorff_distance A (closure A) = 0
[PROOF STEP]
proof (cases "A = {} \<or> (\<not>(bounded A))")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = {} \<or> \<not> bounded A \<Longrightarrow> hausdorff_distance A (closure A) = 0
 2. \<not> (A = {} \<or> \<not> bounded A) \<Longrightarrow> hausdorff_distance A (closure A) = 0
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
A = {} \<or> \<not> bounded A

goal (2 subgoals):
 1. A = {} \<or> \<not> bounded A \<Longrightarrow> hausdorff_distance A (closure A) = 0
 2. \<not> (A = {} \<or> \<not> bounded A) \<Longrightarrow> hausdorff_distance A (closure A) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A = {} \<or> \<not> bounded A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A = {} \<or> \<not> bounded A

goal (1 subgoal):
 1. hausdorff_distance A (closure A) = 0
[PROOF STEP]
unfolding hausdorff_distance_def
[PROOF STATE]
proof (prove)
using this:
A = {} \<or> \<not> bounded A

goal (1 subgoal):
 1. (if A = {} \<or> closure A = {} \<or> \<not> bounded A \<or> \<not> bounded (closure A) then 0 else max (SUP x\<in>A. infdist x (closure A)) (SUP x\<in>closure A. infdist x A)) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hausdorff_distance A (closure A) = 0

goal (1 subgoal):
 1. \<not> (A = {} \<or> \<not> bounded A) \<Longrightarrow> hausdorff_distance A (closure A) = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (A = {} \<or> \<not> bounded A) \<Longrightarrow> hausdorff_distance A (closure A) = 0
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (A = {} \<or> \<not> bounded A)

goal (1 subgoal):
 1. \<not> (A = {} \<or> \<not> bounded A) \<Longrightarrow> hausdorff_distance A (closure A) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (A = {} \<or> \<not> bounded A)
[PROOF STEP]
have "A \<noteq> {}" "bounded A"
[PROOF STATE]
proof (prove)
using this:
\<not> (A = {} \<or> \<not> bounded A)

goal (1 subgoal):
 1. A \<noteq> {} &&& bounded A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<noteq> {}
bounded A

goal (1 subgoal):
 1. \<not> (A = {} \<or> \<not> bounded A) \<Longrightarrow> hausdorff_distance A (closure A) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> {}
bounded A
[PROOF STEP]
have "closure A \<noteq> {}" "bounded (closure A)" "A \<subseteq> closure A"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
bounded A

goal (1 subgoal):
 1. closure A \<noteq> {} &&& bounded (closure A) &&& A \<subseteq> closure A
[PROOF STEP]
using closure_subset
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
bounded A
?S \<subseteq> closure ?S

goal (1 subgoal):
 1. closure A \<noteq> {} &&& bounded (closure A) &&& A \<subseteq> closure A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closure A \<noteq> {}
bounded (closure A)
A \<subseteq> closure A

goal (1 subgoal):
 1. \<not> (A = {} \<or> \<not> bounded A) \<Longrightarrow> hausdorff_distance A (closure A) = 0
[PROOF STEP]
have "infdist x A = 0" if "x \<in> closure A" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist x A = 0
[PROOF STEP]
using in_closure_iff_infdist_zero[OF \<open>A \<noteq> {}\<close>] that
[PROOF STATE]
proof (prove)
using this:
(?x \<in> closure A) = (infdist ?x A = 0)
x \<in> closure A

goal (1 subgoal):
 1. infdist x A = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> closure A \<Longrightarrow> infdist ?x A = 0

goal (1 subgoal):
 1. \<not> (A = {} \<or> \<not> bounded A) \<Longrightarrow> hausdorff_distance A (closure A) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> closure A \<Longrightarrow> infdist ?x A = 0
[PROOF STEP]
have "(SUP x\<in>closure A. infdist x A) = 0"
[PROOF STATE]
proof (prove)
using this:
?x \<in> closure A \<Longrightarrow> infdist ?x A = 0

goal (1 subgoal):
 1. (SUP x\<in>closure A. infdist x A) = 0
[PROOF STEP]
using \<open>closure A \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
?x \<in> closure A \<Longrightarrow> infdist ?x A = 0
closure A \<noteq> {}

goal (1 subgoal):
 1. (SUP x\<in>closure A. infdist x A) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(SUP x\<in>closure A. infdist x A) = 0

goal (1 subgoal):
 1. \<not> (A = {} \<or> \<not> bounded A) \<Longrightarrow> hausdorff_distance A (closure A) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(SUP x\<in>closure A. infdist x A) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(SUP x\<in>closure A. infdist x A) = 0

goal (1 subgoal):
 1. hausdorff_distance A (closure A) = 0
[PROOF STEP]
unfolding hausdorff_distance_subset[OF \<open>A \<subseteq> closure A\<close> \<open>A \<noteq> {}\<close> \<open>bounded (closure A)\<close>]
[PROOF STATE]
proof (prove)
using this:
(SUP x\<in>closure A. infdist x A) = 0

goal (1 subgoal):
 1. (SUP x\<in>closure A. infdist x A) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hausdorff_distance A (closure A) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem tensor_preserves_is_tangle:
 assumes "is_tangle_diagram x"
     and "is_tangle_diagram y"
 shows "is_tangle_diagram (x \<otimes> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram (x \<otimes> y)
[PROOF STEP]
using assms  is_tangle_diagramness
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram x
is_tangle_diagram y
is_tangle_diagram ?x \<and> is_tangle_diagram ?y \<longrightarrow> is_tangle_diagram (?x \<otimes> ?y)

goal (1 subgoal):
 1. is_tangle_diagram (x \<otimes> y)
[PROOF STEP]
by auto


[STATEMENT]
lemma select_unit_norm:
  fixes u::"'a::euclidean_space"
  shows "\<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u
[PROOF STEP]
proof (cases "u = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. u = (0::'a) \<Longrightarrow> \<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u
 2. u \<noteq> (0::'a) \<Longrightarrow> \<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
u = (0::'a)

goal (2 subgoals):
 1. u = (0::'a) \<Longrightarrow> \<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u
 2. u \<noteq> (0::'a) \<Longrightarrow> \<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u = (0::'a)

goal (1 subgoal):
 1. \<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u
[PROOF STEP]
using norm_Basis nonempty_Basis
[PROOF STATE]
proof (prove)
using this:
u = (0::'a)
?u \<in> Basis \<Longrightarrow> norm ?u = 1
Basis \<noteq> {}

goal (1 subgoal):
 1. \<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u

goal (1 subgoal):
 1. u \<noteq> (0::'a) \<Longrightarrow> \<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u \<noteq> (0::'a) \<Longrightarrow> \<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
u \<noteq> (0::'a)

goal (1 subgoal):
 1. u \<noteq> (0::'a) \<Longrightarrow> \<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u
[PROOF STEP]
apply (rule exI[of _ "-u/\<^sub>R norm u"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (- u /\<^sub>R norm u) = 1 \<and> (- u /\<^sub>R norm u) \<bullet> u = - norm u
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
u \<noteq> (0::'a)

goal (1 subgoal):
 1. norm (- u /\<^sub>R norm u) = 1 \<and> (- u /\<^sub>R norm u) \<bullet> u = - norm u
[PROOF STEP]
by (auto simp add: dot_square_norm power2_eq_square)
[PROOF STATE]
proof (state)
this:
\<exists>v. norm v = 1 \<and> v \<bullet> u = - norm u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Show_nat_not_neg:
  \<open>set (Show\<^sub>n\<^sub>a\<^sub>t n) \<subseteq>{CHR ''0'', CHR ''1'', CHR ''2'', CHR ''3'', CHR ''4'',
                     CHR ''5'', CHR ''6'', CHR ''7'', CHR ''8'', CHR ''9''}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (Show\<^sub>n\<^sub>a\<^sub>t n) \<subseteq> {CHR ''0'', CHR ''1'', CHR ''2'', CHR ''3'', CHR ''4'', CHR ''5'', CHR ''6'', CHR ''7'', CHR ''8'', CHR ''9''}
[PROOF STEP]
unfolding Show\<^sub>n\<^sub>a\<^sub>t_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map digit_of_nat (nat_explode n)) \<subseteq> {CHR ''0'', CHR ''1'', CHR ''2'', CHR ''3'', CHR ''4'', CHR ''5'', CHR ''6'', CHR ''7'', CHR ''8'', CHR ''9''}
[PROOF STEP]
using  nat_explode_digits[of n]  img_digit_of_nat imageE image_set subsetI
[PROOF STATE]
proof (prove)
using this:
\<forall>d\<in>set (nat_explode n). d < 10
?n < 10 \<Longrightarrow> digit_of_nat ?n \<in> {CHR ''0'', CHR ''1'', CHR ''2'', CHR ''3'', CHR ''4'', CHR ''5'', CHR ''6'', CHR ''7'', CHR ''8'', CHR ''9''}
\<lbrakk>?b \<in> ?f ` ?A; \<And>x. \<lbrakk>?b = ?f x; x \<in> ?A\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
?f ` set ?xs = set (map ?f ?xs)
(\<And>x. x \<in> ?A \<Longrightarrow> x \<in> ?B) \<Longrightarrow> ?A \<subseteq> ?B

goal (1 subgoal):
 1. set (map digit_of_nat (nat_explode n)) \<subseteq> {CHR ''0'', CHR ''1'', CHR ''2'', CHR ''3'', CHR ''4'', CHR ''5'', CHR ''6'', CHR ''7'', CHR ''8'', CHR ''9''}
[PROOF STEP]
by (smt (verit) imageE image_set subsetI)


[STATEMENT]
theorem "((A \<longrightarrow> B) \<longrightarrow> A) \<longrightarrow> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((A \<longrightarrow> B) \<longrightarrow> A) \<longrightarrow> A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A \<longrightarrow> B) \<longrightarrow> A \<Longrightarrow> A
[PROOF STEP]
assume "(A \<longrightarrow> B) \<longrightarrow> A"
[PROOF STATE]
proof (state)
this:
(A \<longrightarrow> B) \<longrightarrow> A

goal (1 subgoal):
 1. (A \<longrightarrow> B) \<longrightarrow> A \<Longrightarrow> A
[PROOF STEP]
show A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A
[PROOF STEP]
proof (rule classical)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> A \<Longrightarrow> A
[PROOF STEP]
assume "\<not> A"
[PROOF STATE]
proof (state)
this:
\<not> A

goal (1 subgoal):
 1. \<not> A \<Longrightarrow> A
[PROOF STEP]
have "A \<longrightarrow> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<longrightarrow> B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<Longrightarrow> B
[PROOF STEP]
assume A
[PROOF STATE]
proof (state)
this:
A

goal (1 subgoal):
 1. A \<Longrightarrow> B
[PROOF STEP]
with \<open>\<not> A\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> A
A
[PROOF STEP]
show B
[PROOF STATE]
proof (prove)
using this:
\<not> A
A

goal (1 subgoal):
 1. B
[PROOF STEP]
by contradiction
[PROOF STATE]
proof (state)
this:
B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A \<longrightarrow> B

goal (1 subgoal):
 1. \<not> A \<Longrightarrow> A
[PROOF STEP]
with \<open>(A \<longrightarrow> B) \<longrightarrow> A\<close>
[PROOF STATE]
proof (chain)
picking this:
(A \<longrightarrow> B) \<longrightarrow> A
A \<longrightarrow> B
[PROOF STEP]
show A
[PROOF STATE]
proof (prove)
using this:
(A \<longrightarrow> B) \<longrightarrow> A
A \<longrightarrow> B

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pell_square_minus1: "pell (a\<^sup>2 - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pell (a\<^sup>2 - Suc 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> is_square (a\<^sup>2 - Suc 0)
[PROOF STEP]
show "\<not>is_square (a\<^sup>2 - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> is_square (a\<^sup>2 - Suc 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_square (a\<^sup>2 - Suc 0) \<Longrightarrow> False
[PROOF STEP]
assume "is_square (a\<^sup>2 - Suc 0)"
[PROOF STATE]
proof (state)
this:
is_square (a\<^sup>2 - Suc 0)

goal (1 subgoal):
 1. is_square (a\<^sup>2 - Suc 0) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_square (a\<^sup>2 - Suc 0)
[PROOF STEP]
obtain k where "k\<^sup>2 = a\<^sup>2 - 1"
[PROOF STATE]
proof (prove)
using this:
is_square (a\<^sup>2 - Suc 0)

goal (1 subgoal):
 1. (\<And>k. k\<^sup>2 = a\<^sup>2 - 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: is_nth_powerE)
[PROOF STATE]
proof (state)
this:
k\<^sup>2 = a\<^sup>2 - 1

goal (1 subgoal):
 1. is_square (a\<^sup>2 - Suc 0) \<Longrightarrow> False
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
1 < a
k\<^sup>2 = a\<^sup>2 - 1
[PROOF STEP]
have "a\<^sup>2 = Suc (k\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
1 < a
k\<^sup>2 = a\<^sup>2 - 1

goal (1 subgoal):
 1. a\<^sup>2 = Suc (k\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a\<^sup>2 = Suc (k\<^sup>2)

goal (1 subgoal):
 1. is_square (a\<^sup>2 - Suc 0) \<Longrightarrow> False
[PROOF STEP]
hence "a = 1"
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 = Suc (k\<^sup>2)

goal (1 subgoal):
 1. a = 1
[PROOF STEP]
using pell_square_solution_nat_iff[of "1" a k]
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 = Suc (k\<^sup>2)
is_square 1 \<Longrightarrow> (a\<^sup>2 = 1 + 1 * k\<^sup>2) = (a = 1 \<and> (1 = 0 \<or> k = 0))

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

goal (1 subgoal):
 1. is_square (a\<^sup>2 - Suc 0) \<Longrightarrow> False
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
1 < a
a = 1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
1 < a
a = 1

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> is_square (a\<^sup>2 - Suc 0)

goal:
No subgoals!
[PROOF STEP]
qed