[STATEMENT]
lemma in_list_Suc_iff:
  "(xs \<in> list (Suc n) A) = (\<exists>y\<in>A. \<exists>ys \<in> list n A. xs = y#ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> list (Suc n) A) = (\<exists>y\<in>A. \<exists>ys\<in>list n A. xs = y # ys)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> list (Suc n) A) = (\<exists>y\<in>A. \<exists>ys\<in>list n A. xs = y # ys)
[PROOF STEP]
apply (unfold list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> {xs. length xs = Suc n \<and> set xs \<subseteq> A}) = (\<exists>y\<in>A. \<exists>ys\<in>{xs. length xs = n \<and> set xs \<subseteq> A}. xs = y # ys)
[PROOF STEP]
apply (case_tac "xs")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. xs = [] \<Longrightarrow> (xs \<in> {xs. length xs = Suc n \<and> set xs \<subseteq> A}) = (\<exists>y\<in>A. \<exists>ys\<in>{xs. length xs = n \<and> set xs \<subseteq> A}. xs = y # ys)
 2. \<And>a list. xs = a # list \<Longrightarrow> (xs \<in> {xs. length xs = Suc n \<and> set xs \<subseteq> A}) = (\<exists>y\<in>A. \<exists>ys\<in>{xs. length xs = n \<and> set xs \<subseteq> A}. xs = y # ys)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_integrable_cong_AE:
    "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow>
    AE x \<in> A in M. f x = g x \<Longrightarrow> A \<in> sets M \<Longrightarrow>
    set_integrable M A f = set_integrable M A g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> borel_measurable M; g \<in> borel_measurable M; AE x\<in>A in M. f x = g x; A \<in> sets M\<rbrakk> \<Longrightarrow> set_integrable M A f = set_integrable M A g
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> borel_measurable M; g \<in> borel_measurable M; AE x\<in>A in M. f x = g x; A \<in> sets M\<rbrakk> \<Longrightarrow> integrable M (\<lambda>x. indicat_real A x *\<^sub>R f x) = integrable M (\<lambda>x. indicat_real A x *\<^sub>R g x)
[PROOF STEP]
by (rule integrable_cong_AE) auto


[STATEMENT]
lemma map_drop_delete: "map_drop k (map_of ps) = map_of (AList.delete k ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_drop k (map_of ps) = map_of (AList.delete k ps)
[PROOF STEP]
unfolding AList.delete_eq map_drop_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_filter (\<lambda>a'. a' \<noteq> k) (map_of ps) = map_of (filter (\<lambda>(k', uu_). k \<noteq> k') ps)
[PROOF STEP]
apply (subst map_filter_map_of)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (filter (\<lambda>(ka, uu_). ka \<noteq> k) ps) = map_of (filter (\<lambda>(k', uu_). k \<noteq> k') ps)
[PROOF STEP]
apply (rule arg_cong[where f = "map_of"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>(ka, uu_). ka \<noteq> k) ps = filter (\<lambda>(k', uu_). k \<noteq> k') ps
[PROOF STEP]
apply (rule filter_cong[OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set ps \<Longrightarrow> (case x of (ka, uu_) \<Rightarrow> ka \<noteq> k) = (case x of (k', uu_) \<Rightarrow> k \<noteq> k')
[PROOF STEP]
by auto


[STATEMENT]
lemma norm_bfun_disc_le: "norm f \<le> B \<Longrightarrow> (\<Sum>x. l^x * norm (apply_bfun f x)) \<le> (\<Sum>x. l^x * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm f \<le> B \<Longrightarrow> (\<Sum>x. l ^ x * norm (apply_bfun f x)) \<le> (\<Sum>x. l ^ x * B)
[PROOF STEP]
by (fastforce intro!: suminf_le mult_left_mono norm_le_norm_bfun intro: order.trans)


[STATEMENT]
lemma basis_null_space_code[code]: "basis_null_space A = (let GJ = Gauss_Jordan_PA (transpose A);
                                                               rank_A = (if A = 0 then 0 else to_nat (GREATEST a. row a (snd GJ) \<noteq> 0) + 1)
                                                               in {row i (fst GJ) | i. to_nat i \<ge> rank_A})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_null_space A = (let GJ = Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A); rank_A = if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd GJ) \<noteq> 0) + 1 in {row i (fst GJ) |i. rank_A \<le> mod_type_class.to_nat i})
[PROOF STEP]
unfolding basis_null_space_def Let_def P_Gauss_Jordan_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. rank A \<le> mod_type_class.to_nat i} = {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}
[PROOF STEP]
unfolding Gauss_Jordan_PA_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. rank A \<le> mod_type_class.to_nat i} = {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan (Finite_Cartesian_Product.transpose A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}
[PROOF STEP]
unfolding rank_transpose[symmetric, of A]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. rank (Finite_Cartesian_Product.transpose A) \<le> mod_type_class.to_nat i} = {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan (Finite_Cartesian_Product.transpose A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}
[PROOF STEP]
unfolding rank_Gauss_Jordan_code[of "transpose A"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if Finite_Cartesian_Product.transpose A = 0 then 0 else let A' = Gauss_Jordan (Finite_Cartesian_Product.transpose A) in mod_type_class.to_nat (GREATEST a. row a A' \<noteq> 0) + 1) \<le> mod_type_class.to_nat i} = {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan (Finite_Cartesian_Product.transpose A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if Finite_Cartesian_Product.transpose A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan (Finite_Cartesian_Product.transpose A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i} = {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan (Finite_Cartesian_Product.transpose A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}
[PROOF STEP]
unfolding transpose_zero
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan (Finite_Cartesian_Product.transpose A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i} = {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan (Finite_Cartesian_Product.transpose A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}
[PROOF STEP]
..


[STATEMENT]
lemma prefix_fininf_eq_inf_transp[intro, trans]:
      assumes "w\<^sub>1 \<le>\<^sub>F\<^sub>I w\<^sub>2" "w\<^sub>2 =\<^sub>I w\<^sub>3"
      shows "w\<^sub>1 \<preceq>\<^sub>F\<^sub>I w\<^sub>3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w\<^sub>1 \<preceq>\<^sub>F\<^sub>I w\<^sub>3
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
w\<^sub>1 \<le>\<^sub>F\<^sub>I w\<^sub>2
w\<^sub>2 =\<^sub>I w\<^sub>3

goal (1 subgoal):
 1. w\<^sub>1 \<preceq>\<^sub>F\<^sub>I w\<^sub>3
[PROOF STEP]
by blast


[STATEMENT]
lemma isCont_cong:
  assumes "eventually (\<lambda>x. f x = g x) (nhds x)"
  shows "isCont f x \<longleftrightarrow> isCont g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f x = isCont g x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isCont f x = isCont g x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in nhds x. f x = g x
[PROOF STEP]
have [simp]: "f x = g x"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in nhds x. f x = g x

goal (1 subgoal):
 1. f x = g x
[PROOF STEP]
by (rule eventually_nhds_x_imp_x)
[PROOF STATE]
proof (state)
this:
f x = g x

goal (1 subgoal):
 1. isCont f x = isCont g x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in nhds x. f x = g x
[PROOF STEP]
have "eventually (\<lambda>x. f x = g x) (at x)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in nhds x. f x = g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at x. f x = g x
[PROOF STEP]
by (auto simp: eventually_at_filter elim!: eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at x. f x = g x

goal (1 subgoal):
 1. isCont f x = isCont g x
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in nhds x. f x = g x
\<forall>\<^sub>F x in at x. f x = g x
[PROOF STEP]
have "isCont f x \<longleftrightarrow> isCont g x"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in nhds x. f x = g x
\<forall>\<^sub>F x in at x. f x = g x

goal (1 subgoal):
 1. isCont f x = isCont g x
[PROOF STEP]
unfolding isCont_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in nhds x. f x = g x
\<forall>\<^sub>F x in at x. f x = g x

goal (1 subgoal):
 1. f \<midarrow>x\<rightarrow> f x = g \<midarrow>x\<rightarrow> g x
[PROOF STEP]
by (intro filterlim_cong) (auto elim!: eventually_mono)
[PROOF STATE]
proof (state)
this:
isCont f x = isCont g x

goal (1 subgoal):
 1. isCont f x = isCont g x
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in nhds x. f x = g x
isCont f x = isCont g x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in nhds x. f x = g x
isCont f x = isCont g x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem latticeof_relcl_eq: "lattice L ==> latticeof (relcl L) = L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice L \<Longrightarrow> latticeof (relcl L) = L
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. lattice L \<Longrightarrow> latticeof (relcl L) \<subseteq> L
 2. lattice L \<Longrightarrow> L \<subseteq> latticeof (relcl L)
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. lattice L \<Longrightarrow> L \<subseteq> latticeof (relcl L)
 2. lattice L \<Longrightarrow> latticeof (relcl L) \<subseteq> L
[PROOF STEP]
apply (force simp add: latticeof_def relcl_def cl_def, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>lattice L; x \<in> latticeof (relcl L)\<rbrakk> \<Longrightarrow> x \<in> L
[PROOF STEP]
apply (rename_tac X)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>lattice L; X \<in> latticeof (relcl L)\<rbrakk> \<Longrightarrow> X \<in> L
[PROOF STEP]
apply (rule cl_subset_in_lattice)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X. \<lbrakk>lattice L; X \<in> latticeof (relcl L)\<rbrakk> \<Longrightarrow> cl L X \<subseteq> X
 2. \<And>X. \<lbrakk>lattice L; X \<in> latticeof (relcl L)\<rbrakk> \<Longrightarrow> lattice L
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X. \<lbrakk>lattice L; X \<in> latticeof (relcl L)\<rbrakk> \<Longrightarrow> lattice L
 2. \<And>X. \<lbrakk>lattice L; X \<in> latticeof (relcl L)\<rbrakk> \<Longrightarrow> cl L X \<subseteq> X
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>lattice L; X \<in> latticeof (relcl L)\<rbrakk> \<Longrightarrow> cl L X \<subseteq> X
[PROOF STEP]
apply (drule cl_ident_iff [OF lattice_latticeof, THEN iffD2])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>lattice L; cl (latticeof (relcl L)) X = X\<rbrakk> \<Longrightarrow> cl L X \<subseteq> X
[PROOF STEP]
apply (drule equalityD1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>lattice L; cl (latticeof (relcl L)) X \<subseteq> X\<rbrakk> \<Longrightarrow> cl L X \<subseteq> X
[PROOF STEP]
apply (rule subset_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X. \<lbrakk>lattice L; cl (latticeof (relcl L)) X \<subseteq> X\<rbrakk> \<Longrightarrow> cl L X \<subseteq> ?B16 X
 2. \<And>X. \<lbrakk>lattice L; cl (latticeof (relcl L)) X \<subseteq> X\<rbrakk> \<Longrightarrow> ?B16 X \<subseteq> X
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>X. \<lbrakk>lattice L; cl (latticeof (relcl L)) X \<subseteq> X\<rbrakk> \<Longrightarrow> ?B16 X \<subseteq> X
 2. \<And>X. \<lbrakk>lattice L; cl (latticeof (relcl L)) X \<subseteq> X\<rbrakk> \<Longrightarrow> cl L X \<subseteq> ?B16 X
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>lattice L; cl (latticeof (relcl L)) X \<subseteq> X\<rbrakk> \<Longrightarrow> cl L X \<subseteq> cl (latticeof (relcl L)) X
[PROOF STEP]
apply (thin_tac "_ \<subseteq> X")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. lattice L \<Longrightarrow> cl L X \<subseteq> cl (latticeof (relcl L)) X
[PROOF STEP]
apply (cut_tac A=X in UN_singleton)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>lattice L; (\<Union>x\<in>X. {x}) = X\<rbrakk> \<Longrightarrow> cl L X \<subseteq> cl (latticeof (relcl L)) X
[PROOF STEP]
apply (erule subst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. lattice L \<Longrightarrow> cl L (\<Union>x\<in>X. {x}) \<subseteq> cl (latticeof (relcl L)) (\<Union>x\<in>X. {x})
[PROOF STEP]
apply (simp only: cl_UN lattice_latticeof
                  cl_latticeof [OF refl_relcl trans_relcl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. lattice L \<Longrightarrow> (\<Union>x\<in>X. cl L {x}) \<subseteq> (\<Union>x\<in>X. {t. \<exists>s. s \<in> {x} \<and> (s, t) \<in> relcl L})
[PROOF STEP]
apply (simp add: relcl_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma matrix_point_in_block_iff: "i < \<v> \<Longrightarrow> j < \<b> \<Longrightarrow> N $$ (i, j) = 1 \<longleftrightarrow> \<V>s ! i \<in> \<B>s ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < \<v>; j < \<b>\<rbrakk> \<Longrightarrow> (N $$ (i, j) = 1) = (\<V>s ! i \<in> \<B>s ! j)
[PROOF STEP]
by (metis blocks_list_length points_list_length inc_matrix_point_in_block_iff)


[STATEMENT]
lemma coprime_multiplicity:
  assumes "prime (p::nat)" and "m > 0"
  shows "coprime p (m div (p ^ multiplicity p m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime p (m div p ^ multiplicity p m)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> coprime p (m div p ^ multiplicity p m) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> coprime p (m div p ^ multiplicity p m)"
[PROOF STATE]
proof (state)
this:
\<not> coprime p (m div p ^ multiplicity p m)

goal (1 subgoal):
 1. \<not> coprime p (m div p ^ multiplicity p m) \<Longrightarrow> False
[PROOF STEP]
with \<open>prime p\<close>
[PROOF STATE]
proof (chain)
picking this:
prime p
\<not> coprime p (m div p ^ multiplicity p m)
[PROOF STEP]
have "\<exists>q. prime q \<and> q dvd p \<and> q dvd m div p ^ multiplicity p m"
[PROOF STATE]
proof (prove)
using this:
prime p
\<not> coprime p (m div p ^ multiplicity p m)

goal (1 subgoal):
 1. \<exists>q. prime q \<and> q dvd p \<and> q dvd m div p ^ multiplicity p m
[PROOF STEP]
by (metis dvd_refl prime_imp_coprime)
[PROOF STATE]
proof (state)
this:
\<exists>q. prime q \<and> q dvd p \<and> q dvd m div p ^ multiplicity p m

goal (1 subgoal):
 1. \<not> coprime p (m div p ^ multiplicity p m) \<Longrightarrow> False
[PROOF STEP]
with \<open>prime p\<close>
[PROOF STATE]
proof (chain)
picking this:
prime p
\<exists>q. prime q \<and> q dvd p \<and> q dvd m div p ^ multiplicity p m
[PROOF STEP]
have "\<exists>q. q = p \<and> q dvd m div p ^ multiplicity p m"
[PROOF STATE]
proof (prove)
using this:
prime p
\<exists>q. prime q \<and> q dvd p \<and> q dvd m div p ^ multiplicity p m

goal (1 subgoal):
 1. \<exists>q. q = p \<and> q dvd m div p ^ multiplicity p m
[PROOF STEP]
by (metis not_prime_1 prime_nat_iff)
[PROOF STATE]
proof (state)
this:
\<exists>q. q = p \<and> q dvd m div p ^ multiplicity p m

goal (1 subgoal):
 1. \<not> coprime p (m div p ^ multiplicity p m) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>q. q = p \<and> q dvd m div p ^ multiplicity p m
[PROOF STEP]
have "p dvd m div p ^ multiplicity p m"
[PROOF STATE]
proof (prove)
using this:
\<exists>q. q = p \<and> q dvd m div p ^ multiplicity p m

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

goal (1 subgoal):
 1. \<not> coprime p (m div p ^ multiplicity p m) \<Longrightarrow> False
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
prime p
0 < m
p dvd m div p ^ multiplicity p m
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
prime p
0 < m
p dvd m div p ^ multiplicity p m

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma indep_card_eq_dim_span:
  assumes "independent B"
  shows "finite B \<and> card B = dim (span B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite B \<and> card B = dim (span B)
[PROOF STEP]
using dim_span_eq_card_independent[OF assms] finiteI_independent[OF assms]
[PROOF STATE]
proof (prove)
using this:
dim (span B) = card B
finite B

goal (1 subgoal):
 1. finite B \<and> card B = dim (span B)
[PROOF STEP]
by auto


[STATEMENT]
lemma mono_SucI2: "\<forall>n. X (Suc n) \<le> X n \<Longrightarrow> monoseq X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. X (Suc n) \<le> X n \<Longrightarrow> monoseq X
[PROOF STEP]
by (simp add: monoseq_Suc)


[STATEMENT]
lemma convergent_realpow: "0 \<le> x \<Longrightarrow> x \<le> 1 \<Longrightarrow> convergent (\<lambda>n. x ^ n)"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> convergent ((^) x)
[PROOF STEP]
by (blast intro!: Bseq_monoseq_convergent Bseq_realpow monoseq_realpow)


[STATEMENT]
lemma bounded_linear_Re: "bounded_linear Re"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear Re
[PROOF STEP]
by (rule bounded_linear_intro [where K=1]) (simp_all add: norm_complex_def)


[STATEMENT]
lemma pair_vec_vecset_solve[code_unfold]:
shows "pair_vec_vecset (solve A b) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pair_vec_vecset (solve A b) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
unfolding pair_vec_vecset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if Option.is_none (solve A b) then None else Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b)))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Option.is_none (solve A b) \<Longrightarrow> None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
 2. \<not> Option.is_none (solve A b) \<Longrightarrow> Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
assume none_solve_Ab: "Option.is_none (solve A b)"
[PROOF STATE]
proof (state)
this:
Option.is_none (solve A b)

goal (2 subgoals):
 1. Option.is_none (solve A b) \<Longrightarrow> None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
 2. \<not> Option.is_none (solve A b) \<Longrightarrow> Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
show "None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
define GJ_P where "GJ_P = Gauss_Jordan_iarrays_PA (matrix_to_iarray A)"
[PROOF STATE]
proof (state)
this:
GJ_P = Gauss_Jordan_iarrays_PA (matrix_to_iarray A)

goal (1 subgoal):
 1. None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
define P_mult_b where "P_mult_b = fst GJ_P *iv vec_to_iarray b"
[PROOF STATE]
proof (state)
this:
P_mult_b = fst GJ_P *iv vec_to_iarray b

goal (1 subgoal):
 1. None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
define rank_A where "rank_A = length [x\<leftarrow>IArray.list_of (snd GJ_P). \<not> is_zero_iarray x]"
[PROOF STATE]
proof (state)
this:
rank_A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd GJ_P)))

goal (1 subgoal):
 1. None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
have "\<not> consistent A b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> consistent A b
[PROOF STEP]
using none_solve_Ab
[PROOF STATE]
proof (prove)
using this:
Option.is_none (solve A b)

goal (1 subgoal):
 1. \<not> consistent A b
[PROOF STEP]
unfolding solve_def
[PROOF STATE]
proof (prove)
using this:
Option.is_none (if consistent A b then Some (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b)), basis_null_space A) else None)

goal (1 subgoal):
 1. \<not> consistent A b
[PROOF STEP]
unfolding Option.is_none_def
[PROOF STATE]
proof (prove)
using this:
(if consistent A b then Some (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b)), basis_null_space A) else None) = None

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

goal (1 subgoal):
 1. None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
hence "\<not> consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)"
[PROOF STATE]
proof (prove)
using this:
\<not> consistent A b

goal (1 subgoal):
 1. \<not> consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
using matrix_to_iarray_consistent
[PROOF STATE]
proof (prove)
using this:
\<not> consistent A b
consistent ?A ?b = consistent_iarrays (matrix_to_iarray ?A) (vec_to_iarray ?b)

goal (1 subgoal):
 1. \<not> consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)

goal (1 subgoal):
 1. None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
hence "\<not> (if \<not> is_zero_iarray P_mult_b then greatest_not_zero P_mult_b + 1 else 0) \<le> rank_A"
[PROOF STATE]
proof (prove)
using this:
\<not> consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)

goal (1 subgoal):
 1. \<not> (if \<not> is_zero_iarray P_mult_b then greatest_not_zero P_mult_b + 1 else 0) \<le> rank_A
[PROOF STEP]
unfolding GJ_P_def P_mult_b_def rank_A_def
[PROOF STATE]
proof (prove)
using this:
\<not> consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)

goal (1 subgoal):
 1. \<not> (if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))
[PROOF STEP]
using consistent_iarrays_def
[PROOF STATE]
proof (prove)
using this:
\<not> consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)
consistent_iarrays ?A ?b = (let GJ = Gauss_Jordan_iarrays_PA ?A; rank_A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd GJ))); P_mult_b = fst GJ *iv ?b in (if \<not> is_zero_iarray P_mult_b then greatest_not_zero P_mult_b + 1 else 0) \<le> rank_A)

goal (1 subgoal):
 1. \<not> (if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
using this:
\<not> consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)
consistent_iarrays ?A ?b = ((if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA ?A) *iv ?b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA ?A) *iv ?b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA ?A)))))

goal (1 subgoal):
 1. \<not> (if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<not> (if \<not> is_zero_iarray P_mult_b then greatest_not_zero P_mult_b + 1 else 0) \<le> rank_A

goal (1 subgoal):
 1. None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (if \<not> is_zero_iarray P_mult_b then greatest_not_zero P_mult_b + 1 else 0) \<le> rank_A

goal (1 subgoal):
 1. None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
unfolding solve_iarrays_def Let_def
[PROOF STATE]
proof (prove)
using this:
\<not> (if \<not> is_zero_iarray P_mult_b then greatest_not_zero P_mult_b + 1 else 0) \<le> rank_A

goal (1 subgoal):
 1. None = (if (if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))))) then Some (solve_consistent_rref_iarrays (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b), set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<ncols_iarray (matrix_to_iarray A)])) else None)
[PROOF STEP]
unfolding GJ_P_def P_mult_b_def rank_A_def
[PROOF STATE]
proof (prove)
using this:
\<not> (if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))

goal (1 subgoal):
 1. None = (if (if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))))) then Some (solve_consistent_rref_iarrays (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b), set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<ncols_iarray (matrix_to_iarray A)])) else None)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
None = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)

goal (1 subgoal):
 1. \<not> Option.is_none (solve A b) \<Longrightarrow> Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Option.is_none (solve A b) \<Longrightarrow> Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
assume not_none: "\<not> Option.is_none (solve A b)"
[PROOF STATE]
proof (state)
this:
\<not> Option.is_none (solve A b)

goal (1 subgoal):
 1. \<not> Option.is_none (solve A b) \<Longrightarrow> Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
show "Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
define GJ_P where "GJ_P = Gauss_Jordan_iarrays_PA (matrix_to_iarray A)"
[PROOF STATE]
proof (state)
this:
GJ_P = Gauss_Jordan_iarrays_PA (matrix_to_iarray A)

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
define P_mult_b where "P_mult_b = fst GJ_P *iv vec_to_iarray b"
[PROOF STATE]
proof (state)
this:
P_mult_b = fst GJ_P *iv vec_to_iarray b

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
define rank_A where "rank_A = length [x\<leftarrow>IArray.list_of (snd GJ_P) . \<not> is_zero_iarray x]"
[PROOF STATE]
proof (state)
this:
rank_A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd GJ_P)))

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
define GJ_transpose where "GJ_transpose = Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))"
[PROOF STATE]
proof (state)
this:
GJ_transpose = Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
define basis where "basis = set (map (\<lambda>i. row_iarray i (fst GJ_transpose)) [rank_A..<ncols_iarray (matrix_to_iarray A)])"
[PROOF STATE]
proof (state)
this:
basis = set (map (\<lambda>i. row_iarray i (fst GJ_transpose)) [rank_A..<ncols_iarray (matrix_to_iarray A)])

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
define P_mult_b where "P_mult_b = fst GJ_P *iv vec_to_iarray b"
[PROOF STATE]
proof (state)
this:
P_mult_b = fst GJ_P *iv vec_to_iarray b

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
have consistent_Ab: "consistent A b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consistent A b
[PROOF STEP]
using not_none
[PROOF STATE]
proof (prove)
using this:
\<not> Option.is_none (solve A b)

goal (1 subgoal):
 1. consistent A b
[PROOF STEP]
unfolding solve_def
[PROOF STATE]
proof (prove)
using this:
\<not> Option.is_none (if consistent A b then Some (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b)), basis_null_space A) else None)

goal (1 subgoal):
 1. consistent A b
[PROOF STEP]
unfolding Option.is_none_def
[PROOF STATE]
proof (prove)
using this:
(if consistent A b then Some (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b)), basis_null_space A) else None) \<noteq> None

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

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
hence "consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)"
[PROOF STATE]
proof (prove)
using this:
consistent A b

goal (1 subgoal):
 1. consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
using matrix_to_iarray_consistent
[PROOF STATE]
proof (prove)
using this:
consistent A b
consistent ?A ?b = consistent_iarrays (matrix_to_iarray ?A) (vec_to_iarray ?b)

goal (1 subgoal):
 1. consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
hence "(if \<not> is_zero_iarray P_mult_b then greatest_not_zero P_mult_b + 1 else 0) \<le> rank_A"
[PROOF STATE]
proof (prove)
using this:
consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)

goal (1 subgoal):
 1. (if \<not> is_zero_iarray P_mult_b then greatest_not_zero P_mult_b + 1 else 0) \<le> rank_A
[PROOF STEP]
unfolding GJ_P_def P_mult_b_def rank_A_def
[PROOF STATE]
proof (prove)
using this:
consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)

goal (1 subgoal):
 1. (if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))
[PROOF STEP]
using consistent_iarrays_def
[PROOF STATE]
proof (prove)
using this:
consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)
consistent_iarrays ?A ?b = (let GJ = Gauss_Jordan_iarrays_PA ?A; rank_A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd GJ))); P_mult_b = fst GJ *iv ?b in (if \<not> is_zero_iarray P_mult_b then greatest_not_zero P_mult_b + 1 else 0) \<le> rank_A)

goal (1 subgoal):
 1. (if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
using this:
consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)
consistent_iarrays ?A ?b = ((if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA ?A) *iv ?b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA ?A) *iv ?b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA ?A)))))

goal (1 subgoal):
 1. (if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
(if \<not> is_zero_iarray P_mult_b then greatest_not_zero P_mult_b + 1 else 0) \<le> rank_A

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
hence solve_iarrays_rw: "solve_iarrays (matrix_to_iarray A) (vec_to_iarray b) = Some (solve_consistent_rref_iarrays (snd GJ_P) P_mult_b, basis)"
[PROOF STATE]
proof (prove)
using this:
(if \<not> is_zero_iarray P_mult_b then greatest_not_zero P_mult_b + 1 else 0) \<le> rank_A

goal (1 subgoal):
 1. solve_iarrays (matrix_to_iarray A) (vec_to_iarray b) = Some (solve_consistent_rref_iarrays (snd GJ_P) P_mult_b, basis)
[PROOF STEP]
unfolding solve_iarrays_def Let_def P_mult_b_def GJ_P_def rank_A_def basis_def GJ_transpose_def
[PROOF STATE]
proof (prove)
using this:
(if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))

goal (1 subgoal):
 1. (if (if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))))) then Some (solve_consistent_rref_iarrays (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b), set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<ncols_iarray (matrix_to_iarray A)])) else None) = Some (solve_consistent_rref_iarrays (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b), set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<ncols_iarray (matrix_to_iarray A)]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
solve_iarrays (matrix_to_iarray A) (vec_to_iarray b) = Some (solve_consistent_rref_iarrays (snd GJ_P) P_mult_b, basis)

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
have snd_rw: "vec_to_iarray ` basis_null_space A = basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray ` basis_null_space A = basis
[PROOF STEP]
unfolding basis_def GJ_transpose_def rank_A_def GJ_P_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray ` basis_null_space A = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<ncols_iarray (matrix_to_iarray A)])
[PROOF STEP]
unfolding vec_to_iarray_basis_null_space
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_null_space_iarrays (matrix_to_iarray A) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<ncols_iarray (matrix_to_iarray A)])
[PROOF STEP]
unfolding basis_null_space_iarrays_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))))..<ncols_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<ncols_iarray (matrix_to_iarray A)])
[PROOF STEP]
unfolding snd_Gauss_Jordan_iarrays_PA_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays (transpose_iarray (matrix_to_iarray A)))))..<ncols_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays (matrix_to_iarray A))))..<ncols_iarray (matrix_to_iarray A)])
[PROOF STEP]
unfolding rank_iarrays_code[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [rank_iarray (transpose_iarray (matrix_to_iarray A))..<ncols_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (matrix_to_iarray A))))) [rank_iarray (matrix_to_iarray A)..<ncols_iarray (matrix_to_iarray A)])
[PROOF STEP]
unfolding matrix_to_iarray_transpose[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray (Finite_Cartesian_Product.transpose A))))) [rank_iarray (matrix_to_iarray (Finite_Cartesian_Product.transpose A))..<ncols_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray (Finite_Cartesian_Product.transpose A))))) [rank_iarray (matrix_to_iarray A)..<ncols_iarray (matrix_to_iarray A)])
[PROOF STEP]
unfolding matrix_to_iarray_rank[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray (Finite_Cartesian_Product.transpose A))))) [rank (Finite_Cartesian_Product.transpose A)..<ncols_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray (Finite_Cartesian_Product.transpose A))))) [rank A..<ncols_iarray (matrix_to_iarray A)])
[PROOF STEP]
unfolding rank_transpose[symmetric, of A]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray (Finite_Cartesian_Product.transpose A))))) [rank (Finite_Cartesian_Product.transpose A)..<ncols_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray (Finite_Cartesian_Product.transpose A))))) [rank (Finite_Cartesian_Product.transpose A)..<ncols_iarray (matrix_to_iarray A)])
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
vec_to_iarray ` basis_null_space A = basis

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
have fst_rw: "vec_to_iarray (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b))) = solve_consistent_rref_iarrays (snd GJ_P) P_mult_b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b))) = solve_consistent_rref_iarrays (snd GJ_P) P_mult_b
[PROOF STEP]
using vec_to_iarray_solve_consistent_rref[OF rref_Gauss_Jordan, of A "fst (Gauss_Jordan_PA A) *v b"]
[PROOF STATE]
proof (prove)
using this:
vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (matrix_to_iarray (Gauss_Jordan A)) (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b))

goal (1 subgoal):
 1. vec_to_iarray (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b))) = solve_consistent_rref_iarrays (snd GJ_P) P_mult_b
[PROOF STEP]
unfolding solve_system_def Let_def fst_conv
[PROOF STATE]
proof (prove)
using this:
vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (matrix_to_iarray (Gauss_Jordan A)) (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b))

goal (1 subgoal):
 1. vec_to_iarray (solve_consistent_rref (snd (Gauss_Jordan_PA A)) (snd (snd (Gauss_Jordan_PA A), fst (Gauss_Jordan_PA A) *v b))) = solve_consistent_rref_iarrays (snd GJ_P) P_mult_b
[PROOF STEP]
unfolding Gauss_Jordan_PA_eq snd_conv
[PROOF STATE]
proof (prove)
using this:
vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (matrix_to_iarray (Gauss_Jordan A)) (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b))

goal (1 subgoal):
 1. vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (snd GJ_P) P_mult_b
[PROOF STEP]
unfolding GJ_P_def P_mult_b_def
[PROOF STATE]
proof (prove)
using this:
vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (matrix_to_iarray (Gauss_Jordan A)) (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b))

goal (1 subgoal):
 1. vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b)
[PROOF STEP]
unfolding vec_to_iarray_matrix_matrix_mult
[PROOF STATE]
proof (prove)
using this:
vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (matrix_to_iarray (Gauss_Jordan A)) (matrix_to_iarray (fst (Gauss_Jordan_PA A)) *iv vec_to_iarray b)

goal (1 subgoal):
 1. vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b)
[PROOF STEP]
unfolding matrix_to_iarray_fst_Gauss_Jordan_PA[symmetric]
[PROOF STATE]
proof (prove)
using this:
vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (matrix_to_iarray (Gauss_Jordan A)) (matrix_to_iarray (fst (Gauss_Jordan_PA A)) *iv vec_to_iarray b)

goal (1 subgoal):
 1. vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) (matrix_to_iarray (fst (Gauss_Jordan_PA A)) *iv vec_to_iarray b)
[PROOF STEP]
unfolding matrix_to_iarray_snd_Gauss_Jordan_PA[symmetric]
[PROOF STATE]
proof (prove)
using this:
vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (matrix_to_iarray (Gauss_Jordan A)) (matrix_to_iarray (fst (Gauss_Jordan_PA A)) *iv vec_to_iarray b)

goal (1 subgoal):
 1. vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (matrix_to_iarray (snd (Gauss_Jordan_PA A))) (matrix_to_iarray (fst (Gauss_Jordan_PA A)) *iv vec_to_iarray b)
[PROOF STEP]
unfolding Gauss_Jordan_PA_eq
[PROOF STATE]
proof (prove)
using this:
vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (matrix_to_iarray (Gauss_Jordan A)) (matrix_to_iarray (fst (Gauss_Jordan_PA A)) *iv vec_to_iarray b)

goal (1 subgoal):
 1. vec_to_iarray (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b)) = solve_consistent_rref_iarrays (matrix_to_iarray (Gauss_Jordan A)) (matrix_to_iarray (fst (Gauss_Jordan_PA A)) *iv vec_to_iarray b)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
vec_to_iarray (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b))) = solve_consistent_rref_iarrays (snd GJ_P) P_mult_b

goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
unfolding solve_iarrays_rw
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = Some (solve_consistent_rref_iarrays (snd GJ_P) P_mult_b, basis)
[PROOF STEP]
unfolding solve_def if_P[OF consistent_Ab] option.sel fst_conv snd_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Some (vec_to_iarray (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b))), vec_to_iarray ` basis_null_space A) = Some (solve_consistent_rref_iarrays (snd GJ_P) P_mult_b, basis)
[PROOF STEP]
unfolding fst_rw snd_rw
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Some (solve_consistent_rref_iarrays (snd GJ_P) P_mult_b, basis) = Some (solve_consistent_rref_iarrays (snd GJ_P) P_mult_b, basis)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Some (vec_to_iarray (fst (the (solve A b))), vec_to_iarray ` snd (the (solve A b))) = solve_iarrays (matrix_to_iarray A) (vec_to_iarray b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vars_term_list_nth:
  assumes "i < length (vars_term_list (Fun f ts))"
    and "concat_index_split (0, i) (map vars_term_list ts) = (k, j)"
  shows "k < length ts \<and> j < length (vars_term_list (ts ! k)) \<and>
    vars_term_list (Fun f ts) ! i = map vars_term_list ts ! k ! j \<and>
    i = sum_list (map length (map vars_term_list (take k ts))) + j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < length ts \<and> j < length (vars_term_list (ts ! k)) \<and> vars_term_list (Fun f ts) ! i = map vars_term_list ts ! k ! j \<and> i = sum_list (map length (map vars_term_list (take k ts))) + j
[PROOF STEP]
using assms concat_index_split_less_length_concat[of i "map vars_term_list ts" k j]
[PROOF STATE]
proof (prove)
using this:
i < length (vars_term_list (Fun f ts))
concat_index_split (0, i) (map vars_term_list ts) = (k, j)
\<lbrakk>i < length (concat (map vars_term_list ts)); concat_index_split (0, i) (map vars_term_list ts) = (k, j)\<rbrakk> \<Longrightarrow> i = sum_list (map length (take k (map vars_term_list ts))) + j
\<lbrakk>i < length (concat (map vars_term_list ts)); concat_index_split (0, i) (map vars_term_list ts) = (k, j)\<rbrakk> \<Longrightarrow> k < length (map vars_term_list ts)
\<lbrakk>i < length (concat (map vars_term_list ts)); concat_index_split (0, i) (map vars_term_list ts) = (k, j)\<rbrakk> \<Longrightarrow> j < length (map vars_term_list ts ! k)
\<lbrakk>i < length (concat (map vars_term_list ts)); concat_index_split (0, i) (map vars_term_list ts) = (k, j)\<rbrakk> \<Longrightarrow> concat (map vars_term_list ts) ! i = map vars_term_list ts ! k ! j

goal (1 subgoal):
 1. k < length ts \<and> j < length (vars_term_list (ts ! k)) \<and> vars_term_list (Fun f ts) ! i = map vars_term_list ts ! k ! j \<and> i = sum_list (map length (map vars_term_list (take k ts))) + j
[PROOF STEP]
by (auto simp: vars_term_list.simps comp_def take_map)


[STATEMENT]
lemma (in group) cyclic_group:
  "cyclic_group G \<longleftrightarrow> (\<exists>x \<in> carrier G. carrier G = range (\<lambda>n::int. x [^] n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cyclic_group G = (\<exists>x\<in>carrier G. carrier G = range (([^]) x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cyclic_group G = (\<exists>x\<in>carrier G. carrier G = range (([^]) x))
[PROOF STEP]
have "\<And>x. \<lbrakk>x \<in> carrier G; carrier G = range (\<lambda>n::int. x [^] n)\<rbrakk>
         \<Longrightarrow> \<exists>x\<in>carrier G. subgroup_generated G {x} = G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> carrier G; carrier G = range (([^]) x)\<rbrakk> \<Longrightarrow> \<exists>x\<in>carrier G. subgroup_generated G {x} = G
[PROOF STEP]
by (rule_tac x=x in bexI) (auto simp: generate_pow subgroup_generated_def intro!: monoid.equality)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> carrier G; carrier G = range (([^]) ?x)\<rbrakk> \<Longrightarrow> \<exists>x\<in>carrier G. subgroup_generated G {x} = G

goal (1 subgoal):
 1. cyclic_group G = (\<exists>x\<in>carrier G. carrier G = range (([^]) x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x \<in> carrier G; carrier G = range (([^]) ?x)\<rbrakk> \<Longrightarrow> \<exists>x\<in>carrier G. subgroup_generated G {x} = G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier G; carrier G = range (([^]) ?x)\<rbrakk> \<Longrightarrow> \<exists>x\<in>carrier G. subgroup_generated G {x} = G

goal (1 subgoal):
 1. cyclic_group G = (\<exists>x\<in>carrier G. carrier G = range (([^]) x))
[PROOF STEP]
unfolding cyclic_group_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier G; carrier G = range (([^]) ?x)\<rbrakk> \<Longrightarrow> \<exists>x\<in>carrier G. subgroup_generated G {x} = G

goal (1 subgoal):
 1. (\<exists>x\<in>carrier G. subgroup_generated G {x} = G) = (\<exists>x\<in>carrier G. carrier G = range (([^]) x))
[PROOF STEP]
using carrier_subgroup_generated_by_singleton
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier G; carrier G = range (([^]) ?x)\<rbrakk> \<Longrightarrow> \<exists>x\<in>carrier G. subgroup_generated G {x} = G
?x \<in> carrier G \<Longrightarrow> carrier (subgroup_generated G {?x}) = range (([^]) ?x)

goal (1 subgoal):
 1. (\<exists>x\<in>carrier G. subgroup_generated G {x} = G) = (\<exists>x\<in>carrier G. carrier G = range (([^]) x))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
cyclic_group G = (\<exists>x\<in>carrier G. carrier G = range (([^]) x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_neq_zeroI:
  "\<bar>a\<bar> \<ge> k \<Longrightarrow> \<bar>b\<bar> < k \<Longrightarrow> a + b \<noteq> 0"
  "\<bar>a\<bar> > k \<Longrightarrow> \<bar>b\<bar> \<le> k \<Longrightarrow> a + b \<noteq> 0"
  for a k :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>k \<le> \<bar>a\<bar>; \<bar>b\<bar> < k\<rbrakk> \<Longrightarrow> a + b \<noteq> 0) &&& (\<lbrakk>k < \<bar>a\<bar>; \<bar>b\<bar> \<le> k\<rbrakk> \<Longrightarrow> a + b \<noteq> 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma ereal_INF: "\<bar>INF a\<in>A. ereal (f a)\<bar> \<noteq> \<infinity> \<Longrightarrow> ereal (INF a\<in>A. f a) = (INF a\<in>A. ereal (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>INF a\<in>A. ereal (f a)\<bar> \<noteq> \<infinity> \<Longrightarrow> ereal (Inf (f ` A)) = (INF a\<in>A. ereal (f a))
[PROOF STEP]
by (simp add: ereal_Inf image_comp)


[STATEMENT]
lemma HMA_M_0 [transfer_rule]:
  "HMA_M (0\<^sub>m CARD('nr) CARD('nc)) (0 :: 'a :: zero ^ 'nc  ^ 'nr )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HMA_M (0\<^sub>m CARD('nr) CARD('nc)) 0
[PROOF STEP]
unfolding HMA_M_def from_hma\<^sub>m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m CARD('nr) CARD('nc) = Matrix.mat CARD('nr) CARD('nc) (\<lambda>(i, j). 0 $h Bij_Nat.from_nat i $h Bij_Nat.from_nat j)
[PROOF STEP]
by auto


[STATEMENT]
lemma cball_scale:
  assumes "a \<noteq> 0"
  shows   "(\<lambda>x. a *\<^sub>R x) ` cball c r = cball (a *\<^sub>R c :: 'a :: real_normed_vector) (\<bar>a\<bar> * r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
have 1: "(\<lambda>x. a *\<^sub>R x) ` cball c r \<subseteq> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)" if "a \<noteq> 0" for a r and c :: 'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r \<subseteq> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> cball c r \<Longrightarrow> a *\<^sub>R xa \<in> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> cball c r \<Longrightarrow> a *\<^sub>R xa \<in> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
assume x: "x \<in> cball c r"
[PROOF STATE]
proof (state)
this:
x \<in> cball c r

goal (1 subgoal):
 1. \<And>x xa. xa \<in> cball c r \<Longrightarrow> a *\<^sub>R xa \<in> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
have "dist (a *\<^sub>R c) (a *\<^sub>R x) = norm (a *\<^sub>R c - a *\<^sub>R x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (a *\<^sub>R c) (a *\<^sub>R x) = norm (a *\<^sub>R c - a *\<^sub>R x)
[PROOF STEP]
by (auto simp: dist_norm)
[PROOF STATE]
proof (state)
this:
dist (a *\<^sub>R c) (a *\<^sub>R x) = norm (a *\<^sub>R c - a *\<^sub>R x)

goal (1 subgoal):
 1. \<And>x xa. xa \<in> cball c r \<Longrightarrow> a *\<^sub>R xa \<in> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (a *\<^sub>R c) (a *\<^sub>R x) = norm (a *\<^sub>R c - a *\<^sub>R x)

goal (1 subgoal):
 1. \<And>x xa. xa \<in> cball c r \<Longrightarrow> a *\<^sub>R xa \<in> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
have "a *\<^sub>R c - a *\<^sub>R x = a *\<^sub>R (c - x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a *\<^sub>R c - a *\<^sub>R x = a *\<^sub>R (c - x)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
a *\<^sub>R c - a *\<^sub>R x = a *\<^sub>R (c - x)

goal (1 subgoal):
 1. \<And>x xa. xa \<in> cball c r \<Longrightarrow> a *\<^sub>R xa \<in> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (a *\<^sub>R c) (a *\<^sub>R x) = norm (a *\<^sub>R (c - x))
[PROOF STEP]
show "a *\<^sub>R x \<in> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)"
[PROOF STATE]
proof (prove)
using this:
dist (a *\<^sub>R c) (a *\<^sub>R x) = norm (a *\<^sub>R (c - x))

goal (1 subgoal):
 1. a *\<^sub>R x \<in> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
using that x
[PROOF STATE]
proof (prove)
using this:
dist (a *\<^sub>R c) (a *\<^sub>R x) = norm (a *\<^sub>R (c - x))
a \<noteq> 0
x \<in> cball c r

goal (1 subgoal):
 1. a *\<^sub>R x \<in> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
by (auto simp: dist_norm)
[PROOF STATE]
proof (state)
this:
a *\<^sub>R x \<in> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?a \<noteq> 0 \<Longrightarrow> (*\<^sub>R) ?a ` cball ?c ?r \<subseteq> cball (?a *\<^sub>R ?c) (\<bar>?a\<bar> * ?r)

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
have "cball (a *\<^sub>R c) (\<bar>a\<bar> * r) = (\<lambda>x. a *\<^sub>R x) ` (\<lambda>x. inverse a *\<^sub>R x) ` cball (a *\<^sub>R c) (\<bar>a\<bar> * r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball (a *\<^sub>R c) (\<bar>a\<bar> * r) = (*\<^sub>R) a ` (\<lambda>x. x /\<^sub>R a) ` cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
unfolding image_image
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball (a *\<^sub>R c) (\<bar>a\<bar> * r) = (\<lambda>x. a *\<^sub>R (x /\<^sub>R a)) ` cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. cball (a *\<^sub>R c) (\<bar>a\<bar> * r) = (\<lambda>x. a *\<^sub>R (x /\<^sub>R a)) ` cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cball (a *\<^sub>R c) (\<bar>a\<bar> * r) = (*\<^sub>R) a ` (\<lambda>x. x /\<^sub>R a) ` cball (a *\<^sub>R c) (\<bar>a\<bar> * r)

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cball (a *\<^sub>R c) (\<bar>a\<bar> * r) = (*\<^sub>R) a ` (\<lambda>x. x /\<^sub>R a) ` cball (a *\<^sub>R c) (\<bar>a\<bar> * r)

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
have "\<dots> \<subseteq> (\<lambda>x. a *\<^sub>R x) ` cball (inverse a *\<^sub>R (a *\<^sub>R c)) (\<bar>inverse a\<bar> * (\<bar>a\<bar> * r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>R) a ` (\<lambda>x. x /\<^sub>R a) ` cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (*\<^sub>R) a ` cball (a *\<^sub>R c /\<^sub>R a) (\<bar>inverse a\<bar> * (\<bar>a\<bar> * r))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (*\<^sub>R) a ` (\<lambda>x. x /\<^sub>R a) ` cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (*\<^sub>R) a ` cball (a *\<^sub>R c /\<^sub>R a) (\<bar>inverse a\<bar> * (\<bar>a\<bar> * r))
[PROOF STEP]
by (intro image_mono 1) auto
[PROOF STATE]
proof (state)
this:
(*\<^sub>R) a ` (\<lambda>x. x /\<^sub>R a) ` cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (*\<^sub>R) a ` cball (a *\<^sub>R c /\<^sub>R a) (\<bar>inverse a\<bar> * (\<bar>a\<bar> * r))

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(*\<^sub>R) a ` (\<lambda>x. x /\<^sub>R a) ` cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (*\<^sub>R) a ` cball (a *\<^sub>R c /\<^sub>R a) (\<bar>inverse a\<bar> * (\<bar>a\<bar> * r))

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
have "\<dots> = (\<lambda>x. a *\<^sub>R x) ` cball c r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>R) a ` cball (a *\<^sub>R c /\<^sub>R a) (\<bar>inverse a\<bar> * (\<bar>a\<bar> * r)) = (*\<^sub>R) a ` cball c r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball (a *\<^sub>R c /\<^sub>R a) (\<bar>inverse a\<bar> * (\<bar>a\<bar> * r)) = (*\<^sub>R) a ` cball c r
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(*\<^sub>R) a ` cball (a *\<^sub>R c /\<^sub>R a) (\<bar>inverse a\<bar> * (\<bar>a\<bar> * r)) = (*\<^sub>R) a ` cball c r

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (*\<^sub>R) a ` cball c r
[PROOF STEP]
have "cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (\<lambda>x. a *\<^sub>R x) ` cball c r"
[PROOF STATE]
proof (prove)
using this:
cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (*\<^sub>R) a ` cball c r

goal (1 subgoal):
 1. cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (*\<^sub>R) a ` cball c r
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (*\<^sub>R) a ` cball c r

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (*\<^sub>R) a ` cball c r

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> 0
[PROOF STEP]
have "(\<lambda>x. a *\<^sub>R x) ` cball c r \<subseteq> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r \<subseteq> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
by (intro 1) auto
[PROOF STATE]
proof (state)
this:
(*\<^sub>R) a ` cball c r \<subseteq> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (*\<^sub>R) a ` cball c r
(*\<^sub>R) a ` cball c r \<subseteq> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cball (a *\<^sub>R c) (\<bar>a\<bar> * r) \<subseteq> (*\<^sub>R) a ` cball c r
(*\<^sub>R) a ` cball c r \<subseteq> cball (a *\<^sub>R c) (\<bar>a\<bar> * r)

goal (1 subgoal):
 1. (*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(*\<^sub>R) a ` cball c r = cball (a *\<^sub>R c) (\<bar>a\<bar> * r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zfact_prime_is_field:
  assumes "Factorial_Ring.prime (p :: nat)"
  shows "field (ZFact (int p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. field (ZFact (int p))
[PROOF STEP]
using zfact_prime_is_finite_field[OF assms] finite_field_def
[PROOF STATE]
proof (prove)
using this:
finite_field (ZFact (int p))
finite_field ?R \<equiv> field ?R \<and> finite_field_axioms ?R

goal (1 subgoal):
 1. field (ZFact (int p))
[PROOF STEP]
by auto


[STATEMENT]
lemma  H_Inf_pres_fpower:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  shows "Inf_pres f \<Longrightarrow> x \<le> f x \<Longrightarrow> x \<le> fpower f i x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Inf_pres f; x \<le> f x\<rbrakk> \<Longrightarrow> x \<le> fpower f i x
[PROOF STEP]
apply (induct i, simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>x \<le> fpower f i x; Inf_pres f; x \<le> f x\<rbrakk> \<Longrightarrow> x \<le> f (fpower f i x)
[PROOF STEP]
using H_iso_cond2 Inf_pres_iso
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mono ?f; ?y \<le> ?z; ?x \<le> ?f ?y\<rbrakk> \<Longrightarrow> ?x \<le> ?f ?z
Inf_pres ?f \<Longrightarrow> mono ?f

goal (1 subgoal):
 1. \<And>i. \<lbrakk>x \<le> fpower f i x; Inf_pres f; x \<le> f x\<rbrakk> \<Longrightarrow> x \<le> f (fpower f i x)
[PROOF STEP]
by blast


[STATEMENT]
lemma nl32: assumes "(l'::real) \<ge> 1" "r' \<ge> 1" "lr \<ge> 1" "r \<ge> 1"
shows "4 * (l' + r') * (lr + r) * (lr + r' + r) \<le> (l' + lr + r' + r)^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * (l' + r') * (lr + r) * (lr + r' + r) \<le> (l' + lr + r' + r) ^ 3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 4 * (l' + r') * (lr + r) * (lr + r' + r) \<le> (l' + lr + r' + r) ^ 3
[PROOF STEP]
have 1: "lr + r' + r \<le> l' + lr + r' + r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lr + r' + r \<le> l' + lr + r' + r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> l'
1 \<le> r'
1 \<le> lr
1 \<le> r

goal (1 subgoal):
 1. lr + r' + r \<le> l' + lr + r' + r
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
lr + r' + r \<le> l' + lr + r' + r

goal (1 subgoal):
 1. 4 * (l' + r') * (lr + r) * (lr + r' + r) \<le> (l' + lr + r' + r) ^ 3
[PROOF STEP]
have 2: "0 \<le> (l' + lr + r' + r)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (l' + lr + r' + r)\<^sup>2
[PROOF STEP]
by (rule zero_le_power2)
[PROOF STATE]
proof (state)
this:
0 \<le> (l' + lr + r' + r)\<^sup>2

goal (1 subgoal):
 1. 4 * (l' + r') * (lr + r) * (lr + r' + r) \<le> (l' + lr + r' + r) ^ 3
[PROOF STEP]
have 3: "0 \<le> lr + r' + r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> lr + r' + r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> l'
1 \<le> r'
1 \<le> lr
1 \<le> r

goal (1 subgoal):
 1. 0 \<le> lr + r' + r
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
0 \<le> lr + r' + r

goal (1 subgoal):
 1. 4 * (l' + r') * (lr + r) * (lr + r' + r) \<le> (l' + lr + r' + r) ^ 3
[PROOF STEP]
from mult_mono[OF nl31[OF assms] 1 2 3]
[PROOF STATE]
proof (chain)
picking this:
4 * (l' + r') * (lr + r) * (lr + r' + r) \<le> (l' + lr + r' + r)\<^sup>2 * (l' + lr + r' + r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
4 * (l' + r') * (lr + r) * (lr + r' + r) \<le> (l' + lr + r' + r)\<^sup>2 * (l' + lr + r' + r)

goal (1 subgoal):
 1. 4 * (l' + r') * (lr + r) * (lr + r' + r) \<le> (l' + lr + r' + r) ^ 3
[PROOF STEP]
by(simp add: ac_simps numeral_eq_Suc)
[PROOF STATE]
proof (state)
this:
4 * (l' + r') * (lr + r) * (lr + r' + r) \<le> (l' + lr + r' + r) ^ 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Union_mset_empty_conv[simp]: "\<Sum>\<^sub># M = {#} \<longleftrightarrow> (\<forall>i\<in>#M. i = {#})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub># M = {#}) = (\<forall>i\<in>#M. i = {#})
[PROOF STEP]
by (induction M) auto


[STATEMENT]
lemma mgu_subst_range_vars:
  assumes "mgu s t = Some \<sigma>" shows "range_vars \<sigma> \<subseteq> vars_term s \<union> vars_term t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range_vars \<sigma> \<subseteq> fv s \<union> fv t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. range_vars \<sigma> \<subseteq> fv s \<union> fv t
[PROOF STEP]
obtain xs where *: "Unification.unify [(s, t)] [] = Some xs" and [simp]: "subst_of xs = \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>xs. \<lbrakk>unify [(s, t)] [] = Some xs; subst_of xs = \<sigma>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mgu s t = Some \<sigma>

goal (1 subgoal):
 1. (\<And>xs. \<lbrakk>unify [(s, t)] [] = Some xs; subst_of xs = \<sigma>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (simp split: option.splits)
[PROOF STATE]
proof (state)
this:
unify [(s, t)] [] = Some xs
subst_of xs = \<sigma>

goal (1 subgoal):
 1. range_vars \<sigma> \<subseteq> fv s \<union> fv t
[PROOF STEP]
from unify_Some_UNIF [OF *]
[PROOF STATE]
proof (chain)
picking this:
\<exists>ds ss. xs = ds @ [] \<and> subst_of ds = compose ss \<and> UNIF ss (mset [(s, t)]) {#}
[PROOF STEP]
obtain ss
    where "compose ss = \<sigma>" and "UNIF ss {#(s, t)#} {#}"
[PROOF STATE]
proof (prove)
using this:
\<exists>ds ss. xs = ds @ [] \<and> subst_of ds = compose ss \<and> UNIF ss (mset [(s, t)]) {#}

goal (1 subgoal):
 1. (\<And>ss. \<lbrakk>compose ss = \<sigma>; UNIF ss {#(s, t)#} {#}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
compose ss = \<sigma>
UNIF ss {#(s, t)#} {#}

goal (1 subgoal):
 1. range_vars \<sigma> \<subseteq> fv s \<union> fv t
[PROOF STEP]
with UNIF_range_vars_subset [of ss "{#(s, t)#}" "{#}"]
[PROOF STATE]
proof (chain)
picking this:
UNIF ss {#(s, t)#} {#} \<Longrightarrow> range_vars (compose ss) \<subseteq> vars_mset {#(s, t)#}
compose ss = \<sigma>
UNIF ss {#(s, t)#} {#}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
UNIF ss {#(s, t)#} {#} \<Longrightarrow> range_vars (compose ss) \<subseteq> vars_mset {#(s, t)#}
compose ss = \<sigma>
UNIF ss {#(s, t)#} {#}

goal (1 subgoal):
 1. range_vars \<sigma> \<subseteq> fv s \<union> fv t
[PROOF STEP]
by (metis vars_mset_singleton fst_conv snd_conv)
[PROOF STATE]
proof (state)
this:
range_vars \<sigma> \<subseteq> fv s \<union> fv t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in bounded_bilinear) tendsto_left_zero:
  "(f \<longlongrightarrow> 0) F \<Longrightarrow> ((\<lambda>x. f x ** c) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> (0::'a)) F \<Longrightarrow> ((\<lambda>x. f x ** c) \<longlongrightarrow> (0::'c)) F
[PROOF STEP]
by (rule bounded_linear.tendsto_zero [OF bounded_linear_left])