[STATEMENT]
lemma fprod_singletons: "{|a|} |\<times>| {|b|} = {|(a, b)|}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {|a|} |\<times>| {|b|} = {|(a, b)|}
[PROOF STEP]
apply (simp add: fprod_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fset {(a, b)} = {|(a, b)|}
[PROOF STEP]
by (metis fset_inverse fset_simps(1) fset_simps(2))


[STATEMENT]
lemma ccw_scaleR1:
  "det3 0 xr P \<noteq> 0 \<Longrightarrow> 0 < e \<Longrightarrow> ccw 0 xr P \<Longrightarrow> ccw 0 (e*\<^sub>Rxr) P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>det3 0 xr P \<noteq> 0; 0 < e; ccw 0 xr P\<rbrakk> \<Longrightarrow> ccw 0 (e *\<^sub>R xr) P
[PROOF STEP]
by (simp add: ccw_def)


[STATEMENT]
lemma leq_imp_less_eq_atm_of: "L \<le> M \<Longrightarrow> atm_of L \<le> atm_of M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L \<le> M \<Longrightarrow> atm_of L \<le> atm_of M
[PROOF STEP]
unfolding less_eq_literal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atm_of L < atm_of M \<or> atm_of L \<le> atm_of M \<and> is_neg L \<le> is_neg M \<Longrightarrow> atm_of L \<le> atm_of M
[PROOF STEP]
using less_imp_le
[PROOF STATE]
proof (prove)
using this:
?x < ?y \<Longrightarrow> ?x \<le> ?y

goal (1 subgoal):
 1. atm_of L < atm_of M \<or> atm_of L \<le> atm_of M \<and> is_neg L \<le> is_neg M \<Longrightarrow> atm_of L \<le> atm_of M
[PROOF STEP]
by blast


[STATEMENT]
lemma is_interval_neg_translationI:
  assumes "is_interval X"
  shows "is_interval ((-) x ` X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_interval ((-) x ` X)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_interval ((-) x ` X)
[PROOF STEP]
have "(-) x ` X = (+) x ` uminus ` X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (-) x ` X = (+) x ` uminus ` X
[PROOF STEP]
by (force simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
(-) x ` X = (+) x ` uminus ` X

goal (1 subgoal):
 1. is_interval ((-) x ` X)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(-) x ` X = (+) x ` uminus ` X

goal (1 subgoal):
 1. is_interval ((-) x ` X)
[PROOF STEP]
have "is_interval \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_interval ((+) x ` uminus ` X)
[PROOF STEP]
by (metis is_interval_uminusI is_interval_translationI assms)
[PROOF STATE]
proof (state)
this:
is_interval ((+) x ` uminus ` X)

goal (1 subgoal):
 1. is_interval ((-) x ` X)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
is_interval ((-) x ` X)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_interval ((-) x ` X)

goal (1 subgoal):
 1. is_interval ((-) x ` X)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
is_interval ((-) x ` X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NPath_append:
    assumes "T \<noteq> []" and "U \<noteq> []"
    shows "NPath (T @ U) \<longleftrightarrow> NPath T \<and> NPath U \<and> Trgs T \<subseteq> Srcs U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NPath (T @ U) = (NPath T \<and> NPath U \<and> Trgs T \<subseteq> Srcs U)
[PROOF STEP]
using assms NPath_def
[PROOF STATE]
proof (prove)
using this:
T \<noteq> []
U \<noteq> []
NPath ?T \<equiv> Arr ?T \<and> set ?T \<subseteq> \<NN>

goal (1 subgoal):
 1. NPath (T @ U) = (NPath T \<and> NPath U \<and> Trgs T \<subseteq> Srcs U)
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_butterfly_ket[simp]: \<open>(\<Sum>(i::'a::finite)\<in>UNIV. butterfly (ket i) (ket i)) = id_cblinfun\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. selfbutter (ket i)) = id_cblinfun
[PROOF STEP]
apply (rule equal_ket)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<Sum>i\<in>UNIV. selfbutter (ket i)) *\<^sub>V ket x = id_cblinfun *\<^sub>V ket x
[PROOF STEP]
apply (subst complex_vector.linear_sum[where f=\<open>\<lambda>y. y *\<^sub>V ket _\<close>])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. clinear (\<lambda>y. y *\<^sub>V ket x)
 2. \<And>x. (\<Sum>a\<in>UNIV. selfbutter (ket a) *\<^sub>V ket x) = id_cblinfun *\<^sub>V ket x
[PROOF STEP]
apply (auto simp add: scaleC_cblinfun.rep_eq cblinfun.add_left clinearI butterfly_def cblinfun_compose_image cinner_ket)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<Sum>a\<in>UNIV. (if a = x then 1 else 0) *\<^sub>C ket a) = ket x
[PROOF STEP]
apply (subst sum.mono_neutral_cong_right[where S=\<open>{_}\<close>])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>x. finite UNIV
 2. \<And>x. {?uu7 x} \<subseteq> UNIV
 3. \<And>x. \<forall>i\<in>UNIV - {?uu7 x}. (if i = x then 1 else 0) *\<^sub>C ket i = 0
 4. \<And>x xa. xa \<in> {?uu7 x} \<Longrightarrow> (if xa = x then 1 else 0) *\<^sub>C ket xa = ?h7 x xa
 5. \<And>x. sum (?h7 x) {?uu7 x} = ket x
[PROOF STEP]
by auto


[STATEMENT]
lemma imp_to_meta: "Trueprop (P\<longrightarrow>Q) \<equiv> (P\<Longrightarrow>Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<longrightarrow> Q \<equiv> (P \<Longrightarrow> Q)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>P \<longrightarrow> Q; P\<rbrakk> \<Longrightarrow> Q
 2. (P \<Longrightarrow> Q) \<Longrightarrow> P \<longrightarrow> Q
[PROOF STEP]
by auto


[STATEMENT]
lemma Longest_common_prefix_eq_Nil:
  "\<lbrakk>x#ys \<in> L; y#zs \<in> L; x \<noteq> y \<rbrakk> \<Longrightarrow> Longest_common_prefix L = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x # ys \<in> L; y # zs \<in> L; x \<noteq> y\<rbrakk> \<Longrightarrow> Longest_common_prefix L = []
[PROOF STEP]
by (metis Longest_common_prefix_prefix list.inject prefix_Cons)


[STATEMENT]
lemma right_one_conv[simp]: "right j = Suc 0 \<longleftrightarrow> j=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (right j = Suc 0) = (j = 0)
[PROOF STEP]
by (auto simp: right_def)


[STATEMENT]
theorem pr_index_enumerator_main: "nat_to_pr n = nat_to_pr (pr_index_enumerator n m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_pr n = nat_to_pr (pr_index_enumerator n m)
[PROOF STEP]
proof (induct m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. nat_to_pr n = nat_to_pr (pr_index_enumerator n 0)
 2. \<And>m. nat_to_pr n = nat_to_pr (pr_index_enumerator n m) \<Longrightarrow> nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc m))
[PROOF STEP]
show "nat_to_pr n = nat_to_pr (pr_index_enumerator n 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_pr n = nat_to_pr (pr_index_enumerator n 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat_to_pr n = nat_to_pr (pr_index_enumerator n 0)

goal (1 subgoal):
 1. \<And>m. nat_to_pr n = nat_to_pr (pr_index_enumerator n m) \<Longrightarrow> nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc m))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. nat_to_pr n = nat_to_pr (pr_index_enumerator n m) \<Longrightarrow> nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc m))
[PROOF STEP]
fix na
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. nat_to_pr n = nat_to_pr (pr_index_enumerator n m) \<Longrightarrow> nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc m))
[PROOF STEP]
assume A: "nat_to_pr n = nat_to_pr (pr_index_enumerator n na)"
[PROOF STATE]
proof (state)
this:
nat_to_pr n = nat_to_pr (pr_index_enumerator n na)

goal (1 subgoal):
 1. \<And>m. nat_to_pr n = nat_to_pr (pr_index_enumerator n m) \<Longrightarrow> nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc m))
[PROOF STEP]
show "nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc na))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc na))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc na))
[PROOF STEP]
let ?a = "pr_index_enumerator n na"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc na))
[PROOF STEP]
have S1: "pr_index_enumerator n (Suc na) = comp_by_index index_of_id ?a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr_index_enumerator n (Suc na) = comp_by_index index_of_id (pr_index_enumerator n na)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pr_index_enumerator n (Suc na) = comp_by_index index_of_id (pr_index_enumerator n na)

goal (1 subgoal):
 1. nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc na))
[PROOF STEP]
have "nat_to_pr (comp_by_index index_of_id ?a) = (\<lambda> x. (nat_to_pr index_of_id) (nat_to_pr ?a x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_pr (comp_by_index index_of_id (pr_index_enumerator n na)) = (\<lambda>x. nat_to_pr index_of_id (nat_to_pr (pr_index_enumerator n na) x))
[PROOF STEP]
by (rule comp_by_index_main)
[PROOF STATE]
proof (state)
this:
nat_to_pr (comp_by_index index_of_id (pr_index_enumerator n na)) = (\<lambda>x. nat_to_pr index_of_id (nat_to_pr (pr_index_enumerator n na) x))

goal (1 subgoal):
 1. nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc na))
[PROOF STEP]
with index_of_id_main
[PROOF STATE]
proof (chain)
picking this:
nat_to_pr index_of_id = (\<lambda>x. x)
nat_to_pr (comp_by_index index_of_id (pr_index_enumerator n na)) = (\<lambda>x. nat_to_pr index_of_id (nat_to_pr (pr_index_enumerator n na) x))
[PROOF STEP]
have "nat_to_pr (comp_by_index index_of_id ?a) = nat_to_pr ?a"
[PROOF STATE]
proof (prove)
using this:
nat_to_pr index_of_id = (\<lambda>x. x)
nat_to_pr (comp_by_index index_of_id (pr_index_enumerator n na)) = (\<lambda>x. nat_to_pr index_of_id (nat_to_pr (pr_index_enumerator n na) x))

goal (1 subgoal):
 1. nat_to_pr (comp_by_index index_of_id (pr_index_enumerator n na)) = nat_to_pr (pr_index_enumerator n na)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat_to_pr (comp_by_index index_of_id (pr_index_enumerator n na)) = nat_to_pr (pr_index_enumerator n na)

goal (1 subgoal):
 1. nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc na))
[PROOF STEP]
with A S1
[PROOF STATE]
proof (chain)
picking this:
nat_to_pr n = nat_to_pr (pr_index_enumerator n na)
pr_index_enumerator n (Suc na) = comp_by_index index_of_id (pr_index_enumerator n na)
nat_to_pr (comp_by_index index_of_id (pr_index_enumerator n na)) = nat_to_pr (pr_index_enumerator n na)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nat_to_pr n = nat_to_pr (pr_index_enumerator n na)
pr_index_enumerator n (Suc na) = comp_by_index index_of_id (pr_index_enumerator n na)
nat_to_pr (comp_by_index index_of_id (pr_index_enumerator n na)) = nat_to_pr (pr_index_enumerator n na)

goal (1 subgoal):
 1. nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc na))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc na))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nat_to_pr n = nat_to_pr (pr_index_enumerator n (Suc na))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ffb_choice: "fb\<^sub>\<F> (\<lambda>s. F s \<union> G s) P = fb\<^sub>\<F> F P \<inter> fb\<^sub>\<F> G P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fb\<^sub>\<F> (\<lambda>s. F s \<union> G s) P = fb\<^sub>\<F> F P \<inter> fb\<^sub>\<F> G P
[PROOF STEP]
unfolding ffb_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {s. \<forall>s'. s2p (F s \<union> G s) s' \<longrightarrow> s2p P s'} = {s. \<forall>s'. s2p (F s) s' \<longrightarrow> s2p P s'} \<inter> {s. \<forall>s'. s2p (G s) s' \<longrightarrow> s2p P s'}
[PROOF STEP]
by auto


[STATEMENT]
lemma f_arg_min_list_f: "xs \<noteq> [] \<Longrightarrow> f (arg_min_list f xs) = Min (f ` (set xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> [] \<Longrightarrow> f (arg_min_list f xs) = Min (f ` set xs)
[PROOF STEP]
by(induction f xs rule: arg_min_list.induct) (auto simp: min_def intro!: antisym)


[STATEMENT]
lemma finprod_const: \<^marker>\<open>contributor \<open>Jeremy Avigad\<close>\<close>
  assumes a [simp]: "a \<in> carrier G"
    shows "finprod G (\<lambda>x. a) A = a [^] card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Otimes>x\<in>A. a) = a [^] card A
[PROOF STEP]
proof (induct A rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> (\<Otimes>x\<in>A. a) = a [^] card A
 2. (\<Otimes>x\<in>{}. a) = a [^] card {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Otimes>x\<in>F. a) = a [^] card F\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. a) = a [^] card (insert x F)
[PROOF STEP]
case (insert b A)
[PROOF STATE]
proof (state)
this:
finite A
b \<notin> A
(\<Otimes>x\<in>A. a) = a [^] card A

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> (\<Otimes>x\<in>A. a) = a [^] card A
 2. (\<Otimes>x\<in>{}. a) = a [^] card {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Otimes>x\<in>F. a) = a [^] card F\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. a) = a [^] card (insert x F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Otimes>x\<in>insert b A. a) = a [^] card (insert b A)
[PROOF STEP]
proof (subst finprod_insert[OF insert(1-2)])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>x. a) \<in> A \<rightarrow> carrier G
 2. a \<in> carrier G
 3. a \<otimes> (\<Otimes>x\<in>A. a) = a [^] card (insert b A)
[PROOF STEP]
show "a \<otimes> (\<Otimes>x\<in>A. a) = a [^] card (insert b A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes> (\<Otimes>x\<in>A. a) = a [^] card (insert b A)
[PROOF STEP]
by (insert insert, auto, subst m_comm, auto)
[PROOF STATE]
proof (state)
this:
a \<otimes> (\<Otimes>x\<in>A. a) = a [^] card (insert b A)

goal (2 subgoals):
 1. (\<lambda>x. a) \<in> A \<rightarrow> carrier G
 2. a \<in> carrier G
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<Otimes>x\<in>insert b A. a) = a [^] card (insert b A)

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> (\<Otimes>x\<in>A. a) = a [^] card A
 2. (\<Otimes>x\<in>{}. a) = a [^] card {}
[PROOF STEP]
qed auto


[STATEMENT]
lemma entails_implies:
  "\<And>s. \<lbrakk> \<guillemotleft>P\<guillemotright> \<tturnstile> \<guillemotleft>Q\<guillemotright>; P s \<rbrakk> \<Longrightarrow> Q s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. \<lbrakk>\<guillemotleft> P \<guillemotright> \<tturnstile> \<guillemotleft> Q \<guillemotright>; P s\<rbrakk> \<Longrightarrow> Q s
[PROOF STEP]
by(rule ccontr, drule_tac s=s in entailsD, simp)


[STATEMENT]
lemma card_dc_crypto:
  "card dc_crypto = n * 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card dc_crypto = n * 2 ^ n
[PROOF STEP]
unfolding dc_crypto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (Some ` {0..<n} \<times> {xs. length xs = n}) = n * 2 ^ n
[PROOF STEP]
using card_lists_length_eq[of "UNIV :: bool set"]
[PROOF STATE]
proof (prove)
using this:
finite UNIV \<Longrightarrow> card {xs. set xs \<subseteq> UNIV \<and> length xs = ?n} = CARD(bool) ^ ?n

goal (1 subgoal):
 1. card (Some ` {0..<n} \<times> {xs. length xs = n}) = n * 2 ^ n
[PROOF STEP]
by (simp add: card_cartesian_product card_image)


[STATEMENT]
lemma invh_combine:
  "\<lbrakk> invh l; invh r; bheight l = bheight r \<rbrakk>
  \<Longrightarrow> invh (combine l r) \<and> bheight (combine l r) = bheight l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invh l; invh r; bheight l = bheight r\<rbrakk> \<Longrightarrow> invh (combine l r) \<and> bheight (combine l r) = bheight l
[PROOF STEP]
by (induct l r rule: combine.induct)
   (auto simp: invh_baldL_Black split: tree.splits tcolor.splits)


[STATEMENT]
lemma Max_wrt_mono:
  "le x y \<Longrightarrow> x \<in> Max_wrt le \<Longrightarrow> y \<in> Max_wrt le"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>le x y; x \<in> Max_wrt le\<rbrakk> \<Longrightarrow> y \<in> Max_wrt le
[PROOF STEP]
unfolding Max_wrt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>le x y; x \<in> Max_wrt_among le UNIV\<rbrakk> \<Longrightarrow> y \<in> Max_wrt_among le UNIV
[PROOF STEP]
using Max_wrt_among_mono[of x y UNIV]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>le x y; x \<in> Max_wrt_among le UNIV; y \<in> UNIV\<rbrakk> \<Longrightarrow> y \<in> Max_wrt_among le UNIV

goal (1 subgoal):
 1. \<lbrakk>le x y; x \<in> Max_wrt_among le UNIV\<rbrakk> \<Longrightarrow> y \<in> Max_wrt_among le UNIV
[PROOF STEP]
by blast


[STATEMENT]
lemma plus_\<omega>_equals_\<omega>:
  assumes "\<alpha> \<in> elts \<omega>"  shows "\<alpha> + \<omega> = \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> + \<omega> = \<omega>
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<alpha> + \<omega> \<le> \<omega>
 2. \<omega> \<le> \<alpha> + \<omega>
[PROOF STEP]
show "\<alpha> + \<omega> \<le> \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> + \<omega> \<le> \<omega>
[PROOF STEP]
using Ord_trans assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> elts ?j; ?j \<in> elts ?k; Ord ?k\<rbrakk> \<Longrightarrow> ?i \<in> elts ?k
\<alpha> \<in> elts \<omega>

goal (1 subgoal):
 1. \<alpha> + \<omega> \<le> \<omega>
[PROOF STEP]
by (auto simp: elim!: mem_plus_V_E)
[PROOF STATE]
proof (state)
this:
\<alpha> + \<omega> \<le> \<omega>

goal (1 subgoal):
 1. \<omega> \<le> \<alpha> + \<omega>
[PROOF STEP]
show "\<omega> \<le> \<alpha> + \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega> \<le> \<alpha> + \<omega>
[PROOF STEP]
by (simp add: add_le_left assms)
[PROOF STATE]
proof (state)
this:
\<omega> \<le> \<alpha> + \<omega>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma feasible_fixes_bot:
  assumes ft: "feasible t"
  shows "t (\<lambda>s. 0) = (\<lambda>s. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t (\<lambda>s. 0) = (\<lambda>s. 0)
[PROOF STEP]
proof(rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t (\<lambda>s. 0) \<tturnstile> \<lambda>s. 0
 2. \<lambda>s. 0 \<tturnstile> t (\<lambda>s. 0)
[PROOF STEP]
have sb: "sound (\<lambda>s. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sound (\<lambda>s. 0)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
sound (\<lambda>s. 0)

goal (2 subgoals):
 1. t (\<lambda>s. 0) \<tturnstile> \<lambda>s. 0
 2. \<lambda>s. 0 \<tturnstile> t (\<lambda>s. 0)
[PROOF STEP]
with ft
[PROOF STATE]
proof (chain)
picking this:
feasible t
sound (\<lambda>s. 0)
[PROOF STEP]
show "(\<lambda>s. 0) \<le> t (\<lambda>s. 0)"
[PROOF STATE]
proof (prove)
using this:
feasible t
sound (\<lambda>s. 0)

goal (1 subgoal):
 1. \<lambda>s. 0 \<tturnstile> t (\<lambda>s. 0)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
\<lambda>s. 0 \<tturnstile> t (\<lambda>s. 0)

goal (1 subgoal):
 1. t (\<lambda>s. 0) \<tturnstile> \<lambda>s. 0
[PROOF STEP]
thm bound_of_const
[PROOF STATE]
proof (state)
this:
\<lambda>s. 0 \<tturnstile> t (\<lambda>s. 0)

goal (1 subgoal):
 1. t (\<lambda>s. 0) \<tturnstile> \<lambda>s. 0
[PROOF STEP]
from sb
[PROOF STATE]
proof (chain)
picking this:
sound (\<lambda>s. 0)
[PROOF STEP]
have "bounded_by (bound_of (\<lambda>s. 0::real)) (\<lambda>s. 0)"
[PROOF STATE]
proof (prove)
using this:
sound (\<lambda>s. 0)

goal (1 subgoal):
 1. bounded_by (bound_of (\<lambda>s. 0)) (\<lambda>s. 0)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
bounded_by (bound_of (\<lambda>s. 0)) (\<lambda>s. 0)

goal (1 subgoal):
 1. t (\<lambda>s. 0) \<tturnstile> \<lambda>s. 0
[PROOF STEP]
hence "bounded_by 0 (\<lambda>s. 0::real)"
[PROOF STATE]
proof (prove)
using this:
bounded_by (bound_of (\<lambda>s. 0)) (\<lambda>s. 0)

goal (1 subgoal):
 1. bounded_by 0 (\<lambda>s. 0)
[PROOF STEP]
by(simp add:bound_of_const)
[PROOF STATE]
proof (state)
this:
bounded_by 0 (\<lambda>s. 0)

goal (1 subgoal):
 1. t (\<lambda>s. 0) \<tturnstile> \<lambda>s. 0
[PROOF STEP]
with ft
[PROOF STATE]
proof (chain)
picking this:
feasible t
bounded_by 0 (\<lambda>s. 0)
[PROOF STEP]
have "bounded_by 0 (t (\<lambda>s. 0))"
[PROOF STATE]
proof (prove)
using this:
feasible t
bounded_by 0 (\<lambda>s. 0)

goal (1 subgoal):
 1. bounded_by 0 (t (\<lambda>s. 0))
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
bounded_by 0 (t (\<lambda>s. 0))

goal (1 subgoal):
 1. t (\<lambda>s. 0) \<tturnstile> \<lambda>s. 0
[PROOF STEP]
thus "t (\<lambda>s. 0) \<le> (\<lambda>s. 0)"
[PROOF STATE]
proof (prove)
using this:
bounded_by 0 (t (\<lambda>s. 0))

goal (1 subgoal):
 1. t (\<lambda>s. 0) \<tturnstile> \<lambda>s. 0
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
t (\<lambda>s. 0) \<tturnstile> \<lambda>s. 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_regpart_shift_conv_fps_shift:
  "m \<ge> 0 \<Longrightarrow> fls_regpart (fls_shift m f) = fps_shift (nat m) (fls_regpart f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> m \<Longrightarrow> fls_regpart (fls_shift m f) = fps_shift (nat m) (fls_regpart f)
[PROOF STEP]
by (intro fps_ext) simp_all


[STATEMENT]
lemma push_list1: "push (push_list a ns) n = push_list a (n # ns)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push (push_list a ns) n = push_list a (n # ns)
[PROOF STEP]
unfolding push_def push_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. if i = 0 then n else if i - 1 < length ns then ns ! (i - 1) else a (i - 1 - length ns)) = (\<lambda>i. if i < length (n # ns) then (n # ns) ! i else a (i - length (n # ns)))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma division_of_closed:
  fixes i :: "'n::euclidean_space set"
  shows "s division_of i \<Longrightarrow> closed i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s division_of i \<Longrightarrow> closed i
[PROOF STEP]
unfolding division_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite s \<and> (\<forall>K\<in>s. K \<subseteq> i \<and> K \<noteq> {} \<and> (\<exists>a b. K = cbox a b)) \<and> (\<forall>K1\<in>s. \<forall>K2\<in>s. K1 \<noteq> K2 \<longrightarrow> interior K1 \<inter> interior K2 = {}) \<and> \<Union> s = i \<Longrightarrow> closed i
[PROOF STEP]
by fastforce


[STATEMENT]
lemma strictly_maximal_literal_exists :

  "\<forall>C. (((finite C) \<and> (card C) = n \<and> n \<noteq> 0 \<and> (\<not> (tautology C))))
    \<longrightarrow> (\<exists>A. (strictly_maximal_literal C A))" (is "?P n")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>C. finite C \<and> card C = n \<and> n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>C. finite C \<and> card C = 0 \<and> 0 \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
 2. \<And>n. \<forall>C. finite C \<and> card C = n \<and> n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A) \<Longrightarrow> \<forall>C. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
show "(?P 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>C. finite C \<and> card C = 0 \<and> 0 \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>C. finite C \<and> card C = 0 \<and> 0 \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)

goal (1 subgoal):
 1. \<And>n. \<forall>C. finite C \<and> card C = n \<and> n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A) \<Longrightarrow> \<forall>C. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<forall>C. finite C \<and> card C = n \<and> n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A) \<Longrightarrow> \<forall>C. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<forall>C. finite C \<and> card C = n \<and> n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A) \<Longrightarrow> \<forall>C. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
assume "?P n"
[PROOF STATE]
proof (state)
this:
\<forall>C. finite C \<and> card C = n \<and> n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)

goal (1 subgoal):
 1. \<And>n. \<forall>C. finite C \<and> card C = n \<and> n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A) \<Longrightarrow> \<forall>C. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
show "?P (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>C. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
fix C
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
show "(finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> (tautology C))
              \<longrightarrow> (\<exists>A. (strictly_maximal_literal C A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
assume "finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not>(tautology C)"
[PROOF STATE]
proof (state)
this:
finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C

goal (1 subgoal):
 1. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
hence "(finite C)" and "(card C) = (Suc n)" and "(\<not> (tautology C))"
[PROOF STATE]
proof (prove)
using this:
finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C

goal (1 subgoal):
 1. finite C &&& card C = Suc n &&& \<not> tautology C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite C
card C = Suc n
\<not> tautology C

goal (1 subgoal):
 1. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
have "C \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<noteq> {}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. C = {} \<Longrightarrow> False
[PROOF STEP]
assume "C = {}"
[PROOF STATE]
proof (state)
this:
C = {}

goal (1 subgoal):
 1. C = {} \<Longrightarrow> False
[PROOF STEP]
from \<open>finite C\<close> and \<open>C = {}\<close>
[PROOF STATE]
proof (chain)
picking this:
finite C
C = {}
[PROOF STEP]
have "card C = 0"
[PROOF STATE]
proof (prove)
using this:
finite C
C = {}

goal (1 subgoal):
 1. card C = 0
[PROOF STEP]
using card_0_eq
[PROOF STATE]
proof (prove)
using this:
finite C
C = {}
finite ?A \<Longrightarrow> (card ?A = 0) = (?A = {})

goal (1 subgoal):
 1. card C = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card C = 0

goal (1 subgoal):
 1. C = {} \<Longrightarrow> False
[PROOF STEP]
from \<open>card C = 0\<close> and \<open>card C = Suc n\<close>
[PROOF STATE]
proof (chain)
picking this:
card C = 0
card C = Suc n
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
card C = 0
card C = Suc n

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
C \<noteq> {}

goal (1 subgoal):
 1. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
C \<noteq> {}
[PROOF STEP]
obtain L where "L \<in> C"
[PROOF STATE]
proof (prove)
using this:
C \<noteq> {}

goal (1 subgoal):
 1. (\<And>L. L \<in> C \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
L \<in> C

goal (1 subgoal):
 1. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
from \<open>\<not>tautology C\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> tautology C
[PROOF STEP]
have "\<not>tautology (C - { L })"
[PROOF STATE]
proof (prove)
using this:
\<not> tautology C

goal (1 subgoal):
 1. \<not> tautology (C - {L})
[PROOF STEP]
using tautology_monotonous
[PROOF STATE]
proof (prove)
using this:
\<not> tautology C
\<lbrakk>tautology ?C; ?C \<subseteq> ?D\<rbrakk> \<Longrightarrow> tautology ?D

goal (1 subgoal):
 1. \<not> tautology (C - {L})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> tautology (C - {L})

goal (1 subgoal):
 1. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
from \<open>L \<in> C\<close> and  \<open>finite C\<close>
[PROOF STATE]
proof (chain)
picking this:
L \<in> C
finite C
[PROOF STEP]
have "Suc (card (C - { L })) = card C"
[PROOF STATE]
proof (prove)
using this:
L \<in> C
finite C

goal (1 subgoal):
 1. Suc (card (C - {L})) = card C
[PROOF STEP]
using card_Suc_Diff1
[PROOF STATE]
proof (prove)
using this:
L \<in> C
finite C
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> Suc (card (?A - {?x})) = card ?A

goal (1 subgoal):
 1. Suc (card (C - {L})) = card C
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Suc (card (C - {L})) = card C

goal (1 subgoal):
 1. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
with \<open>card C = Suc n\<close>
[PROOF STATE]
proof (chain)
picking this:
card C = Suc n
Suc (card (C - {L})) = card C
[PROOF STEP]
have "card (C - { L }) = n"
[PROOF STATE]
proof (prove)
using this:
card C = Suc n
Suc (card (C - {L})) = card C

goal (1 subgoal):
 1. card (C - {L}) = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (C - {L}) = n

goal (1 subgoal):
 1. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
show "\<exists>A. (strictly_maximal_literal C A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
 2. \<not> ?P \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
assume "card C = 1"
[PROOF STATE]
proof (state)
this:
card C = 1

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
 2. \<not> ?P \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
from this and  \<open>card C = Suc n\<close>
[PROOF STATE]
proof (chain)
picking this:
card C = 1
card C = Suc n
[PROOF STEP]
have "n = 0"
[PROOF STATE]
proof (prove)
using this:
card C = 1
card C = Suc n

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
 2. \<not> ?P \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
from this and \<open>finite C\<close> and \<open>card (C - { L }) = n\<close>
[PROOF STATE]
proof (chain)
picking this:
n = 0
finite C
card (C - {L}) = n
[PROOF STEP]
have "C - { L } = {}"
[PROOF STATE]
proof (prove)
using this:
n = 0
finite C
card (C - {L}) = n

goal (1 subgoal):
 1. C - {L} = {}
[PROOF STEP]
using card_0_eq
[PROOF STATE]
proof (prove)
using this:
n = 0
finite C
card (C - {L}) = n
finite ?A \<Longrightarrow> (card ?A = 0) = (?A = {})

goal (1 subgoal):
 1. C - {L} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C - {L} = {}

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
 2. \<not> ?P \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
from this and \<open>L \<in> C\<close>
[PROOF STATE]
proof (chain)
picking this:
C - {L} = {}
L \<in> C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
C - {L} = {}
L \<in> C

goal (1 subgoal):
 1. \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
unfolding strictly_maximal_literal_def
[PROOF STATE]
proof (prove)
using this:
C - {L} = {}
L \<in> C

goal (1 subgoal):
 1. \<exists>A. A \<in> C \<and> (\<forall>B. B \<in> C \<and> A \<noteq> B \<longrightarrow> literal_ordering B A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>A. strictly_maximal_literal C A

goal (1 subgoal):
 1. card C \<noteq> 1 \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card C \<noteq> 1 \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
assume "card C \<noteq> 1"
[PROOF STATE]
proof (state)
this:
card C \<noteq> 1

goal (1 subgoal):
 1. card C \<noteq> 1 \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
from \<open>finite C\<close>
[PROOF STATE]
proof (chain)
picking this:
finite C
[PROOF STEP]
have "finite (C - { L })"
[PROOF STATE]
proof (prove)
using this:
finite C

goal (1 subgoal):
 1. finite (C - {L})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (C - {L})

goal (1 subgoal):
 1. card C \<noteq> 1 \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
from  \<open>Suc (card (C - { L })) = card C\<close> and \<open>card C \<noteq> 1\<close>
                    and \<open>(card (C - { L })) = n\<close>
[PROOF STATE]
proof (chain)
picking this:
Suc (card (C - {L})) = card C
card C \<noteq> 1
card (C - {L}) = n
[PROOF STEP]
have "n \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
Suc (card (C - {L})) = card C
card C \<noteq> 1
card (C - {L}) = n

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

goal (1 subgoal):
 1. card C \<noteq> 1 \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
from this and \<open>finite (C - { L })\<close> and \<open>card (C - { L }) = n\<close>
                    and \<open>\<not>tautology (C - { L })\<close> and \<open>?P n\<close>
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
finite (C - {L})
card (C - {L}) = n
\<not> tautology (C - {L})
\<forall>C. finite C \<and> card C = n \<and> n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)
[PROOF STEP]
obtain A where "strictly_maximal_literal (C - { L }) A"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
finite (C - {L})
card (C - {L}) = n
\<not> tautology (C - {L})
\<forall>C. finite C \<and> card C = n \<and> n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)

goal (1 subgoal):
 1. (\<And>A. strictly_maximal_literal (C - {L}) A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
strictly_maximal_literal (C - {L}) A

goal (1 subgoal):
 1. card C \<noteq> 1 \<Longrightarrow> \<exists>A. strictly_maximal_literal C A
[PROOF STEP]
show "\<exists>M. strictly_maximal_literal C M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
 2. \<not> ?P \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
assume "(atom L, atom A) \<in> atom_ordering"
[PROOF STATE]
proof (state)
this:
(atom L, atom A) \<in> atom_ordering

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
 2. \<not> ?P \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(atom L, atom A) \<in> atom_ordering
[PROOF STEP]
have "literal_ordering L A"
[PROOF STATE]
proof (prove)
using this:
(atom L, atom A) \<in> atom_ordering

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
 2. \<not> ?P \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
from this and \<open>strictly_maximal_literal (C - { L }) A\<close>
[PROOF STATE]
proof (chain)
picking this:
literal_ordering L A
strictly_maximal_literal (C - {L}) A
[PROOF STEP]
have "strictly_maximal_literal C A"
[PROOF STATE]
proof (prove)
using this:
literal_ordering L A
strictly_maximal_literal (C - {L}) A

goal (1 subgoal):
 1. strictly_maximal_literal C A
[PROOF STEP]
unfolding strictly_maximal_literal_def
[PROOF STATE]
proof (prove)
using this:
literal_ordering L A
A \<in> C - {L} \<and> (\<forall>B. B \<in> C - {L} \<and> A \<noteq> B \<longrightarrow> literal_ordering B A)

goal (1 subgoal):
 1. A \<in> C \<and> (\<forall>B. B \<in> C \<and> A \<noteq> B \<longrightarrow> literal_ordering B A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
strictly_maximal_literal C A

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
 2. \<not> ?P \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
strictly_maximal_literal C A

goal (1 subgoal):
 1. \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>M. strictly_maximal_literal C M

goal (1 subgoal):
 1. (atom L, atom A) \<notin> atom_ordering \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (atom L, atom A) \<notin> atom_ordering \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
assume "(atom L, atom A) \<notin> atom_ordering"
[PROOF STATE]
proof (state)
this:
(atom L, atom A) \<notin> atom_ordering

goal (1 subgoal):
 1. (atom L, atom A) \<notin> atom_ordering \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
have l_cases: "L = (Pos (atom L)) \<or> L = (Neg (atom L))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L = Pos (atom L) \<or> L = Neg (atom L)
[PROOF STEP]
by ((rule atom_property [of "(atom L)"]), auto)
[PROOF STATE]
proof (state)
this:
L = Pos (atom L) \<or> L = Neg (atom L)

goal (1 subgoal):
 1. (atom L, atom A) \<notin> atom_ordering \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
have a_cases: "A = (Pos (atom A)) \<or> A = (Neg (atom A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = Pos (atom A) \<or> A = Neg (atom A)
[PROOF STEP]
by ((rule atom_property [of "(atom A)"]), auto)
[PROOF STATE]
proof (state)
this:
A = Pos (atom A) \<or> A = Neg (atom A)

goal (1 subgoal):
 1. (atom L, atom A) \<notin> atom_ordering \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
from l_cases and a_cases and\<open>(strictly_maximal_literal (C - { L }) A)\<close>
                        and \<open>\<not> (tautology C)\<close> and \<open>L \<in> C\<close>
[PROOF STATE]
proof (chain)
picking this:
L = Pos (atom L) \<or> L = Neg (atom L)
A = Pos (atom A) \<or> A = Neg (atom A)
strictly_maximal_literal (C - {L}) A
\<not> tautology C
L \<in> C
[PROOF STEP]
have "atom L \<noteq> atom A"
[PROOF STATE]
proof (prove)
using this:
L = Pos (atom L) \<or> L = Neg (atom L)
A = Pos (atom A) \<or> A = Neg (atom A)
strictly_maximal_literal (C - {L}) A
\<not> tautology C
L \<in> C

goal (1 subgoal):
 1. atom L \<noteq> atom A
[PROOF STEP]
unfolding strictly_maximal_literal_def and tautology_def
[PROOF STATE]
proof (prove)
using this:
L = Pos (atom L) \<or> L = Neg (atom L)
A = Pos (atom A) \<or> A = Neg (atom A)
A \<in> C - {L} \<and> (\<forall>B. B \<in> C - {L} \<and> A \<noteq> B \<longrightarrow> literal_ordering B A)
\<nexists>A. Pos A \<in> C \<and> Neg A \<in> C
L \<in> C

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

goal (1 subgoal):
 1. (atom L, atom A) \<notin> atom_ordering \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
from this and \<open>(atom L, atom A) \<notin> atom_ordering\<close> and atom_ordering_total
[PROOF STATE]
proof (chain)
picking this:
atom L \<noteq> atom A
(atom L, atom A) \<notin> atom_ordering
\<forall>x y. x \<noteq> y \<longrightarrow> (x, y) \<in> atom_ordering \<or> (y, x) \<in> atom_ordering
[PROOF STEP]
have "(atom A,atom L) \<in> atom_ordering"
[PROOF STATE]
proof (prove)
using this:
atom L \<noteq> atom A
(atom L, atom A) \<notin> atom_ordering
\<forall>x y. x \<noteq> y \<longrightarrow> (x, y) \<in> atom_ordering \<or> (y, x) \<in> atom_ordering

goal (1 subgoal):
 1. (atom A, atom L) \<in> atom_ordering
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(atom A, atom L) \<in> atom_ordering

goal (1 subgoal):
 1. (atom L, atom A) \<notin> atom_ordering \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
hence "literal_ordering A L"
[PROOF STATE]
proof (prove)
using this:
(atom A, atom L) \<in> atom_ordering

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

goal (1 subgoal):
 1. (atom L, atom A) \<notin> atom_ordering \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
from this and \<open>L \<in> C\<close> and \<open>strictly_maximal_literal (C - { L }) A\<close>
                        and literal_ordering_trans
[PROOF STATE]
proof (chain)
picking this:
literal_ordering A L
L \<in> C
strictly_maximal_literal (C - {L}) A
\<lbrakk>literal_ordering ?A ?B; literal_ordering ?B ?C\<rbrakk> \<Longrightarrow> literal_ordering ?A ?C
[PROOF STEP]
have "strictly_maximal_literal C L"
[PROOF STATE]
proof (prove)
using this:
literal_ordering A L
L \<in> C
strictly_maximal_literal (C - {L}) A
\<lbrakk>literal_ordering ?A ?B; literal_ordering ?B ?C\<rbrakk> \<Longrightarrow> literal_ordering ?A ?C

goal (1 subgoal):
 1. strictly_maximal_literal C L
[PROOF STEP]
unfolding strictly_maximal_literal_def
[PROOF STATE]
proof (prove)
using this:
literal_ordering A L
L \<in> C
A \<in> C - {L} \<and> (\<forall>B. B \<in> C - {L} \<and> A \<noteq> B \<longrightarrow> literal_ordering B A)
\<lbrakk>literal_ordering ?A ?B; literal_ordering ?B ?C\<rbrakk> \<Longrightarrow> literal_ordering ?A ?C

goal (1 subgoal):
 1. L \<in> C \<and> (\<forall>B. B \<in> C \<and> L \<noteq> B \<longrightarrow> literal_ordering B L)
[PROOF STEP]
unfolding strictly_maximal_literal_def
[PROOF STATE]
proof (prove)
using this:
literal_ordering A L
L \<in> C
A \<in> C - {L} \<and> (\<forall>B. B \<in> C - {L} \<and> A \<noteq> B \<longrightarrow> literal_ordering B A)
\<lbrakk>literal_ordering ?A ?B; literal_ordering ?B ?C\<rbrakk> \<Longrightarrow> literal_ordering ?A ?C

goal (1 subgoal):
 1. L \<in> C \<and> (\<forall>B. B \<in> C \<and> L \<noteq> B \<longrightarrow> literal_ordering B L)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
strictly_maximal_literal C L

goal (1 subgoal):
 1. (atom L, atom A) \<notin> atom_ordering \<Longrightarrow> \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
strictly_maximal_literal C L

goal (1 subgoal):
 1. \<exists>M. strictly_maximal_literal C M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>M. strictly_maximal_literal C M

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>M. strictly_maximal_literal C M

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>A. strictly_maximal_literal C A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>C. finite C \<and> card C = Suc n \<and> Suc n \<noteq> 0 \<and> \<not> tautology C \<longrightarrow> (\<exists>A. strictly_maximal_literal C A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma formulaTrueAppendValuation:
  fixes formula :: Formula and valuation :: Valuation and valuation' :: Valuation
  assumes "formulaTrue formula valuation"
  shows "formulaTrue formula (valuation @ valuation')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. formulaTrue formula (valuation @ valuation')
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
formulaTrue formula valuation

goal (1 subgoal):
 1. formulaTrue formula (valuation @ valuation')
[PROOF STEP]
by (induct formula) (auto simp add:clauseTrueAppendValuation)


[STATEMENT]
lemma correctness_pure:
  fixes t :: "'a tree"
  assumes distinct: "\<And>xs :: 'a list. distinct (fst (run_state (label_list xs) s))"
  shows "distinct (labels (fst (run_state (label_tree t) s)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (labels (fst (run_state (label_tree t) s)))
[PROOF STEP]
using label_tree_list[of t, THEN arg_cong, of "\<lambda>f. run_state f s"] assms[of "labels t"]
[PROOF STATE]
proof (prove)
using this:
run_state (State_Monad.ap (State_Monad.return labels) (label_tree t)) s = run_state (label_list (labels t)) s
distinct (fst (run_state (label_list (labels t)) s))

goal (1 subgoal):
 1. distinct (labels (fst (run_state (label_tree t) s)))
[PROOF STEP]
by(cases "run_state (label_list (labels t)) s")(simp add: State_Monad.ap_def split_beta)


[STATEMENT]
lemma uniformI1:
  assumes "e>0" "\<And>x y. \<lbrakk>x\<in>S;y\<in>S;dist x y<e\<rbrakk> \<Longrightarrow> x =y "
  shows "uniform_discrete S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_discrete S
[PROOF STEP]
unfolding uniform_discrete_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e>0. \<forall>x\<in>S. \<forall>y\<in>S. dist x y < e \<longrightarrow> x = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < e
\<lbrakk>?x \<in> S; ?y \<in> S; dist ?x ?y < e\<rbrakk> \<Longrightarrow> ?x = ?y

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x\<in>S. \<forall>y\<in>S. dist x y < e \<longrightarrow> x = y
[PROOF STEP]
by auto


[STATEMENT]
lemma Red_I_of_Red_F_subset: "N' \<subseteq> Red_F N \<Longrightarrow> Red_I N \<subseteq> Red_I (N - N')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N' \<subseteq> Red_F N \<Longrightarrow> Red_I N \<subseteq> Red_I (N - N')
[PROOF STEP]
unfolding Red_F_conv Red_I_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N' \<subseteq> fin_std_red.Red_F N \<Longrightarrow> fin_std_red.Red_I N \<subseteq> fin_std_red.Red_I (N - N')
[PROOF STEP]
by (rule fin_std_red.Red_I_of_Red_F_subset)


[STATEMENT]
lemma Liminf_llist_LNil[simp]: "Liminf_llist LNil = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Liminf_llist LNil = {}
[PROOF STEP]
unfolding Liminf_llist_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>i\<in>{i. enat i < llength LNil}. \<Inter> (lnth LNil ` {j. i \<le> j \<and> enat j < llength LNil})) = {}
[PROOF STEP]
by simp


[STATEMENT]
lemma i_Exec_Stream_Init_Pre_Post1_iAll_iNext: "
  \<lbrakk> result = i_Exec_Comp_Stream_Init trans_fun input c;
    \<forall>x_n c_n. P1 x_n \<and> P2 c_n \<longrightarrow> Q (trans_fun x_n c_n);
    \<forall>t\<in>I. inext t I' = Suc t \<rbrakk> \<Longrightarrow>
  \<box> t I. (P1 (input t) \<and> P2 (result t) \<longrightarrow> (\<circle> t1 t I'. Q (result t1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>result = i_Exec_Comp_Stream_Init trans_fun input c; \<forall>x_n c_n. P1 x_n \<and> P2 c_n \<longrightarrow> Q (trans_fun x_n c_n); \<forall>t\<in>I. inext t I' = Suc t\<rbrakk> \<Longrightarrow> \<box> t I. P1 (input t) \<and> P2 (result t) \<longrightarrow> (\<circle> t1 t I'. Q (result t1))
[PROOF STEP]
by (rule iallI, simp add: iNext_def i_Exec_Stream_Init_Pre_Post1)


[STATEMENT]
lemma (in Module) mr_cospOpTr:"\<lbrakk>submodule R M H; m \<in> carrier M; n \<in> carrier M\<rbrakk>
        \<Longrightarrow> mr_cospOp M H (m \<uplus>\<^bsub>M\<^esub> H) (n \<uplus>\<^bsub>M\<^esub> H) = (m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cospOp M H (m \<uplus>\<^bsub>M\<^esub> H) (n \<uplus>\<^bsub>M\<^esub> H) = (m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (cut_tac module_is_ag, frule aGroup.b_ag_group)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; m \<in> carrier M; n \<in> carrier M; aGroup M; Group (b_ag M)\<rbrakk> \<Longrightarrow> mr_cospOp M H (m \<uplus>\<^bsub>M\<^esub> H) (n \<uplus>\<^bsub>M\<^esub> H) = (m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (simp add:mr_cospOp_def mr_coset_def agop_gop [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; m \<in> carrier M; n \<in> carrier M; aGroup M; Group (b_ag M)\<rbrakk> \<Longrightarrow> c_top (b_ag M) H (m \<uplus>\<^bsub>M\<^esub> H) (n \<uplus>\<^bsub>M\<^esub> H) = m \<cdot>\<^bsub>b_ag M\<^esub> n \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (simp add:ag_carrier_carrier [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; m \<in> carrier (b_ag M); n \<in> carrier (b_ag M); aGroup M; Group (b_ag M)\<rbrakk> \<Longrightarrow> c_top (b_ag M) H (m \<uplus>\<^bsub>M\<^esub> H) (n \<uplus>\<^bsub>M\<^esub> H) = m \<cdot>\<^bsub>b_ag M\<^esub> n \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (simp add:submodule_def, (erule conjE)+,
       frule aGroup.asubg_nsubg, assumption+, simp add:ar_coset_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<in> carrier (b_ag M); n \<in> carrier (b_ag M); aGroup M; Group (b_ag M); H \<subseteq> carrier M; M +> H; \<forall>a m. a \<in> carrier R \<and> m \<in> H \<longrightarrow> a \<cdot>\<^sub>s m \<in> H; b_ag M \<triangleright> H\<rbrakk> \<Longrightarrow> c_top (b_ag M) H (H \<bullet>\<^bsub>b_ag M\<^esub> m) (H \<bullet>\<^bsub>b_ag M\<^esub> n) = H \<bullet>\<^bsub>b_ag M\<^esub> (m \<cdot>\<^bsub>b_ag M\<^esub> n)
[PROOF STEP]
apply (simp add:Group.c_top_welldef[THEN sym, of "b_ag M" H m n])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ordinal_oSuc_minus2: "x < y \<Longrightarrow> oSuc x - y = x - y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> oSuc x - y = x - y
[PROOF STEP]
by (simp add: minus_ordinal_def linorder_not_le[symmetric])


[STATEMENT]
lemma obj_isoI:
  assumes "f : a \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>\<^esub> b"
  shows "a \<approx>\<^sub>o\<^sub>b\<^sub>j\<^bsub>\<CC>\<^esub> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<approx>\<^sub>o\<^sub>b\<^sub>j\<^bsub>\<CC>\<^esub> b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f : a \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>\<^esub> b

goal (1 subgoal):
 1. a \<approx>\<^sub>o\<^sub>b\<^sub>j\<^bsub>\<CC>\<^esub> b
[PROOF STEP]
unfolding obj_iso_def
[PROOF STATE]
proof (prove)
using this:
f : a \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>\<^esub> b

goal (1 subgoal):
 1. Ex (is_iso_arr \<CC> a b)
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_axis[simp]:
  fixes q :: "('a::semiring_0)"
  shows "(\<Sum>j\<in>UNIV. f j * axis i q $ j) = f i * q"
    and "(\<Sum>j\<in>UNIV. axis i q $ j * f j) = q * f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>UNIV. f j * axis i q $ j) = f i * q &&& (\<Sum>j\<in>UNIV. axis i q $ j * f j) = q * f i
[PROOF STEP]
unfolding axis_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>UNIV. f j * (\<chi>ia. if ia = i then q else (0::'a)) $ j) = f i * q &&& (\<Sum>j\<in>UNIV. (\<chi>ia. if ia = i then q else (0::'a)) $ j * f j) = q * f i
[PROOF STEP]
by(auto simp: vec_eq_iff)


[STATEMENT]
lemma tau_seq: "\<tau> (x \<cdot> y) = \<tau> x + \<nu> x \<cdot> \<tau> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> (x \<cdot> y) = \<tau> x + \<nu> x \<cdot> \<tau> y
[PROOF STEP]
using local.add_comm nu_def tau_def x_y_split zero_assoc3
[PROOF STATE]
proof (prove)
using this:
?x + ?y = ?y + ?x
\<nu> ?x = ?x \<sqinter> nc
\<tau> ?x = ?x \<cdot> (0::'a)
(?x \<sqinter> nc) \<cdot> ?y + ?x \<cdot> (0::'a) = ?x \<cdot> ?y
?x \<cdot> ?y \<cdot> (0::'a) = ?x \<cdot> (?y \<cdot> (0::'a))

goal (1 subgoal):
 1. \<tau> (x \<cdot> y) = \<tau> x + \<nu> x \<cdot> \<tau> y
[PROOF STEP]
by presburger


[STATEMENT]
lemma (in Ring) ring_distrib3:"\<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R;
      y \<in> carrier R \<rbrakk> \<Longrightarrow> (a \<plusminus> b) \<cdot>\<^sub>r (x \<plusminus> y) =
                                          a \<cdot>\<^sub>r x \<plusminus> a \<cdot>\<^sub>r y \<plusminus> b \<cdot>\<^sub>r x \<plusminus> b \<cdot>\<^sub>r y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> (a \<plusminus> b) \<cdot>\<^sub>r (x \<plusminus> y) = a \<cdot>\<^sub>r x \<plusminus> a \<cdot>\<^sub>r y \<plusminus> b \<cdot>\<^sub>r x \<plusminus> b \<cdot>\<^sub>r y
[PROOF STEP]
apply (subst ring_distrib2)+
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> x \<plusminus> y \<in> carrier R
 2. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> a \<in> carrier R
 3. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> b \<in> carrier R
 4. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r (x \<plusminus> y) \<plusminus> b \<cdot>\<^sub>r (x \<plusminus> y) = a \<cdot>\<^sub>r x \<plusminus> a \<cdot>\<^sub>r y \<plusminus> b \<cdot>\<^sub>r x \<plusminus> b \<cdot>\<^sub>r y
[PROOF STEP]
apply (cut_tac ring_is_ag)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> x \<plusminus> y \<in> carrier R
 2. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> a \<in> carrier R
 3. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> b \<in> carrier R
 4. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r (x \<plusminus> y) \<plusminus> b \<cdot>\<^sub>r (x \<plusminus> y) = a \<cdot>\<^sub>r x \<plusminus> a \<cdot>\<^sub>r y \<plusminus> b \<cdot>\<^sub>r x \<plusminus> b \<cdot>\<^sub>r y
[PROOF STEP]
apply (rule aGroup.ag_pOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r (x \<plusminus> y) \<plusminus> b \<cdot>\<^sub>r (x \<plusminus> y) = a \<cdot>\<^sub>r x \<plusminus> a \<cdot>\<^sub>r y \<plusminus> b \<cdot>\<^sub>r x \<plusminus> b \<cdot>\<^sub>r y
[PROOF STEP]
apply ((subst ring_distrib1)+, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r x \<plusminus> a \<cdot>\<^sub>r y \<plusminus> b \<cdot>\<^sub>r (x \<plusminus> y) = a \<cdot>\<^sub>r x \<plusminus> a \<cdot>\<^sub>r y \<plusminus> b \<cdot>\<^sub>r x \<plusminus> b \<cdot>\<^sub>r y
[PROOF STEP]
apply (subst ring_distrib1, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r x \<plusminus> a \<cdot>\<^sub>r y \<plusminus> (b \<cdot>\<^sub>r x \<plusminus> b \<cdot>\<^sub>r y) = a \<cdot>\<^sub>r x \<plusminus> a \<cdot>\<^sub>r y \<plusminus> b \<cdot>\<^sub>r x \<plusminus> b \<cdot>\<^sub>r y
[PROOF STEP]
apply (rule pop_aassoc [THEN sym, of "a \<cdot>\<^sub>r x \<plusminus> a \<cdot>\<^sub>r y" "b \<cdot>\<^sub>r x" "b \<cdot>\<^sub>r y"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r x \<plusminus> a \<cdot>\<^sub>r y \<in> carrier R
 2. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> b \<cdot>\<^sub>r x \<in> carrier R
 3. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> b \<cdot>\<^sub>r y \<in> carrier R
[PROOF STEP]
apply (cut_tac ring_is_ag, rule aGroup.ag_pOp_closed, assumption)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r x \<in> carrier R
 2. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r y \<in> carrier R
 3. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> b \<cdot>\<^sub>r x \<in> carrier R
 4. \<lbrakk>a \<in> carrier R; b \<in> carrier R; x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> b \<cdot>\<^sub>r y \<in> carrier R
[PROOF STEP]
apply (simp add:ring_tOp_closed)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem "\<forall>(x::int). ((2 dvd x) = (\<forall>(y::int). x \<noteq> 2*y + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. even x = (\<forall>y. x \<noteq> 2 * y + 1)
[PROOF STEP]
by presburger


[STATEMENT]
lemma length_addition[simp]: "length (addition a b c) = 7"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (addition a b c) = 7
[PROOF STEP]
by(auto simp: addition.simps)


[STATEMENT]
lemma is_distr_orD: "is_distr (\<Otimes>\<^sub>\<or>\<^sub>D) d r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_distr (\<Otimes>\<^sub>\<or>\<^sub>D) d r
[PROOF STEP]
apply (simp add: is_distr_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>N P1 P2. d o\<^sub>f (N \<Otimes>\<^sub>\<or>\<^sub>D P1 \<Oplus> P2 \<circ> r) = (d o\<^sub>f (N \<Otimes>\<^sub>\<or>\<^sub>D P1 \<circ> r)) \<Oplus> (d o\<^sub>f (N \<Otimes>\<^sub>\<or>\<^sub>D P2 \<circ> r))
[PROOF STEP]
apply (rule allI)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N P1 P2. d o\<^sub>f (N \<Otimes>\<^sub>\<or>\<^sub>D P1 \<Oplus> P2 \<circ> r) = (d o\<^sub>f (N \<Otimes>\<^sub>\<or>\<^sub>D P1 \<circ> r)) \<Oplus> (d o\<^sub>f (N \<Otimes>\<^sub>\<or>\<^sub>D P2 \<circ> r))
[PROOF STEP]
apply (rule distr_orD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N P1 P2. P1 \<Oplus> P2 = P1 \<Oplus> P2
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma exists_convergent_min_stabilizer:
  assumes hind: "\<forall>m<n. \<forall>C D. C \<subseteq> G \<longrightarrow> D \<subseteq> G \<longrightarrow> finite C \<longrightarrow> finite D \<longrightarrow> C \<noteq> {} \<longrightarrow>
    D \<noteq> {} \<longrightarrow> card (sumset C D) + card C = m \<longrightarrow>
    card (sumset C (stabilizer (sumset C D))) + card (sumset D (stabilizer (sumset C D))) -
    card ((stabilizer (sumset C D)))
    \<le> card (sumset C D)" and hAG: "A \<subseteq> G" and hBG: "B \<subseteq> G" and hA: "finite A" and
    hB: "finite B" and hAne: "A \<noteq> {}" and "A \<inter> B \<noteq> {}" and
    hcardsum: "card (sumset A B) + card A = n" and hintercardA: "card (A \<inter> B) < card A"
  obtains X where "convergent X A B" and "\<And> Y. Y \<in> convergent_set A B \<Longrightarrow>
    card (stabilizer Y) \<ge> card (stabilizer X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?C0 = "sumset (A \<inter> B) (A \<union> B)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have hC0ne: "?C0 \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset (A \<inter> B) (A \<union> B) \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>m<n. \<forall>C D. C \<subseteq> G \<longrightarrow> D \<subseteq> G \<longrightarrow> finite C \<longrightarrow> finite D \<longrightarrow> C \<noteq> {} \<longrightarrow> D \<noteq> {} \<longrightarrow> card (sumset C D) + card C = m \<longrightarrow> card (sumset C (stabilizer (sumset C D))) + card (sumset D (stabilizer (sumset C D))) - card (stabilizer (sumset C D)) \<le> card (sumset C D)
A \<subseteq> G
B \<subseteq> G
finite A
finite B
A \<noteq> {}
A \<inter> B \<noteq> {}
card (sumset A B) + card A = n
card (A \<inter> B) < card A

goal (1 subgoal):
 1. sumset (A \<inter> B) (A \<union> B) \<noteq> {}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
sumset (A \<inter> B) (A \<union> B) \<noteq> {}

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sumset (A \<inter> B) (A \<union> B) \<noteq> {}

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "finite ?C0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (sumset (A \<inter> B) (A \<union> B))
[PROOF STEP]
using sumset_inter_union_subset finite_sumset assms
[PROOF STATE]
proof (prove)
using this:
sumset (?A \<inter> ?B) (?A \<union> ?B) \<subseteq> sumset ?A ?B
\<lbrakk>finite ?A; finite ?B\<rbrakk> \<Longrightarrow> finite (sumset ?A ?B)
\<forall>m<n. \<forall>C D. C \<subseteq> G \<longrightarrow> D \<subseteq> G \<longrightarrow> finite C \<longrightarrow> finite D \<longrightarrow> C \<noteq> {} \<longrightarrow> D \<noteq> {} \<longrightarrow> card (sumset C D) + card C = m \<longrightarrow> card (sumset C (stabilizer (sumset C D))) + card (sumset D (stabilizer (sumset C D))) - card (stabilizer (sumset C D)) \<le> card (sumset C D)
A \<subseteq> G
B \<subseteq> G
finite A
finite B
A \<noteq> {}
A \<inter> B \<noteq> {}
card (sumset A B) + card A = n
card (A \<inter> B) < card A

goal (1 subgoal):
 1. finite (sumset (A \<inter> B) (A \<union> B))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (sumset (A \<inter> B) (A \<union> B))

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sumset (A \<inter> B) (A \<union> B) \<noteq> {}
finite (sumset (A \<inter> B) (A \<union> B))
[PROOF STEP]
have "finite (stabilizer ?C0)"
[PROOF STATE]
proof (prove)
using this:
sumset (A \<inter> B) (A \<union> B) \<noteq> {}
finite (sumset (A \<inter> B) (A \<union> B))

goal (1 subgoal):
 1. finite (stabilizer (sumset (A \<inter> B) (A \<union> B)))
[PROOF STEP]
using stabilizer_finite
[PROOF STATE]
proof (prove)
using this:
sumset (A \<inter> B) (A \<union> B) \<noteq> {}
finite (sumset (A \<inter> B) (A \<union> B))
\<lbrakk>?S \<subseteq> G; ?S \<noteq> {}; finite ?S\<rbrakk> \<Longrightarrow> finite (stabilizer ?S)

goal (1 subgoal):
 1. finite (stabilizer (sumset (A \<inter> B) (A \<union> B)))
[PROOF STEP]
using sumset_subset_carrier
[PROOF STATE]
proof (prove)
using this:
sumset (A \<inter> B) (A \<union> B) \<noteq> {}
finite (sumset (A \<inter> B) (A \<union> B))
\<lbrakk>?S \<subseteq> G; ?S \<noteq> {}; finite ?S\<rbrakk> \<Longrightarrow> finite (stabilizer ?S)
sumset ?A ?B \<subseteq> G

goal (1 subgoal):
 1. finite (stabilizer (sumset (A \<inter> B) (A \<union> B)))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
finite (stabilizer (sumset (A \<inter> B) (A \<union> B)))

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (stabilizer (sumset (A \<inter> B) (A \<union> B)))
[PROOF STEP]
have hcard_sumset_le: "card (A \<inter> B) \<le> card (sumset (A \<inter> B) (stabilizer ?C0))"
[PROOF STATE]
proof (prove)
using this:
finite (stabilizer (sumset (A \<inter> B) (A \<union> B)))

goal (1 subgoal):
 1. card (A \<inter> B) \<le> card (sumset (A \<inter> B) (stabilizer (sumset (A \<inter> B) (A \<union> B))))
[PROOF STEP]
using card_le_sumset sumset_commute sub_unit_closed assms
[PROOF STATE]
proof (prove)
using this:
finite (stabilizer (sumset (A \<inter> B) (A \<union> B)))
\<lbrakk>finite ?A; ?a \<in> ?A; ?a \<in> G; finite ?B; ?B \<subseteq> G\<rbrakk> \<Longrightarrow> card ?B \<le> card (sumset ?A ?B)
sumset ?A ?B = sumset ?B ?A
\<zero> \<in> stabilizer ?A
\<forall>m<n. \<forall>C D. C \<subseteq> G \<longrightarrow> D \<subseteq> G \<longrightarrow> finite C \<longrightarrow> finite D \<longrightarrow> C \<noteq> {} \<longrightarrow> D \<noteq> {} \<longrightarrow> card (sumset C D) + card C = m \<longrightarrow> card (sumset C (stabilizer (sumset C D))) + card (sumset D (stabilizer (sumset C D))) - card (stabilizer (sumset C D)) \<le> card (sumset C D)
A \<subseteq> G
B \<subseteq> G
finite A
finite B
A \<noteq> {}
A \<inter> B \<noteq> {}
card (sumset A B) + card A = n
card (A \<inter> B) < card A

goal (1 subgoal):
 1. card (A \<inter> B) \<le> card (sumset (A \<inter> B) (stabilizer (sumset (A \<inter> B) (A \<union> B))))
[PROOF STEP]
by (metis Int_Un_eq(3) Un_subset_iff finite_Int unit_closed)
[PROOF STATE]
proof (state)
this:
card (A \<inter> B) \<le> card (sumset (A \<inter> B) (stabilizer (sumset (A \<inter> B) (A \<union> B))))

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "card ?C0 \<le> card (sumset A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (sumset (A \<inter> B) (A \<union> B)) \<le> card (sumset A B)
[PROOF STEP]
using card_mono sumset_inter_union_subset finite_sumset assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> card ?A \<le> card ?B
sumset (?A \<inter> ?B) (?A \<union> ?B) \<subseteq> sumset ?A ?B
\<lbrakk>finite ?A; finite ?B\<rbrakk> \<Longrightarrow> finite (sumset ?A ?B)
\<forall>m<n. \<forall>C D. C \<subseteq> G \<longrightarrow> D \<subseteq> G \<longrightarrow> finite C \<longrightarrow> finite D \<longrightarrow> C \<noteq> {} \<longrightarrow> D \<noteq> {} \<longrightarrow> card (sumset C D) + card C = m \<longrightarrow> card (sumset C (stabilizer (sumset C D))) + card (sumset D (stabilizer (sumset C D))) - card (stabilizer (sumset C D)) \<le> card (sumset C D)
A \<subseteq> G
B \<subseteq> G
finite A
finite B
A \<noteq> {}
A \<inter> B \<noteq> {}
card (sumset A B) + card A = n
card (A \<inter> B) < card A

goal (1 subgoal):
 1. card (sumset (A \<inter> B) (A \<union> B)) \<le> card (sumset A B)
[PROOF STEP]
by (simp add: card_mono finite_sumset hA hB sumset_inter_union_subset)
[PROOF STATE]
proof (state)
this:
card (sumset (A \<inter> B) (A \<union> B)) \<le> card (sumset A B)

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (sumset (A \<inter> B) (A \<union> B)) \<le> card (sumset A B)
[PROOF STEP]
have "card ?C0 + card (A \<inter> B) < card (sumset A B) + card A"
[PROOF STATE]
proof (prove)
using this:
card (sumset (A \<inter> B) (A \<union> B)) \<le> card (sumset A B)

goal (1 subgoal):
 1. card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) < card (sumset A B) + card A
[PROOF STEP]
using hintercardA
[PROOF STATE]
proof (prove)
using this:
card (sumset (A \<inter> B) (A \<union> B)) \<le> card (sumset A B)
card (A \<inter> B) < card A

goal (1 subgoal):
 1. card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) < card (sumset A B) + card A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) < card (sumset A B) + card A

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) < card (sumset A B) + card A
[PROOF STEP]
obtain m where "m < n" and "card ?C0 + card (A \<inter> B) = m"
[PROOF STATE]
proof (prove)
using this:
card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) < card (sumset A B) + card A

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>m < n; card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) = m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using hcardsum
[PROOF STATE]
proof (prove)
using this:
card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) < card (sumset A B) + card A
card (sumset A B) + card A = n

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>m < n; card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) = m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m < n
card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) = m

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m < n
card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) = m
[PROOF STEP]
have "card (sumset (A \<inter> B) (stabilizer ?C0)) +
    card (sumset (A \<union> B) (stabilizer ?C0)) - card (stabilizer ?C0) \<le> card ?C0"
[PROOF STATE]
proof (prove)
using this:
m < n
card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) = m

goal (1 subgoal):
 1. card (sumset (A \<inter> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) - card (stabilizer (sumset (A \<inter> B) (A \<union> B))) \<le> card (sumset (A \<inter> B) (A \<union> B))
[PROOF STEP]
using assms finite_Un finite_Int
[PROOF STATE]
proof (prove)
using this:
m < n
card (sumset (A \<inter> B) (A \<union> B)) + card (A \<inter> B) = m
\<forall>m<n. \<forall>C D. C \<subseteq> G \<longrightarrow> D \<subseteq> G \<longrightarrow> finite C \<longrightarrow> finite D \<longrightarrow> C \<noteq> {} \<longrightarrow> D \<noteq> {} \<longrightarrow> card (sumset C D) + card C = m \<longrightarrow> card (sumset C (stabilizer (sumset C D))) + card (sumset D (stabilizer (sumset C D))) - card (stabilizer (sumset C D)) \<le> card (sumset C D)
A \<subseteq> G
B \<subseteq> G
finite A
finite B
A \<noteq> {}
A \<inter> B \<noteq> {}
card (sumset A B) + card A = n
card (A \<inter> B) < card A
finite (?F \<union> ?G) = (finite ?F \<and> finite ?G)
finite ?F \<or> finite ?G \<Longrightarrow> finite (?F \<inter> ?G)

goal (1 subgoal):
 1. card (sumset (A \<inter> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) - card (stabilizer (sumset (A \<inter> B) (A \<union> B))) \<le> card (sumset (A \<inter> B) (A \<union> B))
[PROOF STEP]
by (metis Int_Un_eq(4) Un_empty Un_subset_iff)
[PROOF STATE]
proof (state)
this:
card (sumset (A \<inter> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) - card (stabilizer (sumset (A \<inter> B) (A \<union> B))) \<le> card (sumset (A \<inter> B) (A \<union> B))

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (sumset (A \<inter> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) - card (stabilizer (sumset (A \<inter> B) (A \<union> B))) \<le> card (sumset (A \<inter> B) (A \<union> B))
[PROOF STEP]
have "card ?C0 + card (stabilizer ?C0) \<ge>
    card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer ?C0))"
[PROOF STATE]
proof (prove)
using this:
card (sumset (A \<inter> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) - card (stabilizer (sumset (A \<inter> B) (A \<union> B))) \<le> card (sumset (A \<inter> B) (A \<union> B))

goal (1 subgoal):
 1. card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) \<le> card (sumset (A \<inter> B) (A \<union> B)) + card (stabilizer (sumset (A \<inter> B) (A \<union> B)))
[PROOF STEP]
using hcard_sumset_le
[PROOF STATE]
proof (prove)
using this:
card (sumset (A \<inter> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) - card (stabilizer (sumset (A \<inter> B) (A \<union> B))) \<le> card (sumset (A \<inter> B) (A \<union> B))
card (A \<inter> B) \<le> card (sumset (A \<inter> B) (stabilizer (sumset (A \<inter> B) (A \<union> B))))

goal (1 subgoal):
 1. card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) \<le> card (sumset (A \<inter> B) (A \<union> B)) + card (stabilizer (sumset (A \<inter> B) (A \<union> B)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) \<le> card (sumset (A \<inter> B) (A \<union> B)) + card (stabilizer (sumset (A \<inter> B) (A \<union> B)))

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) \<le> card (sumset (A \<inter> B) (A \<union> B)) + card (stabilizer (sumset (A \<inter> B) (A \<union> B)))
[PROOF STEP]
have "?C0 \<in> convergent_set A B"
[PROOF STATE]
proof (prove)
using this:
card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) \<le> card (sumset (A \<inter> B) (A \<union> B)) + card (stabilizer (sumset (A \<inter> B) (A \<union> B)))

goal (1 subgoal):
 1. sumset (A \<inter> B) (A \<union> B) \<in> convergent_set A B
[PROOF STEP]
using convergent_set_def convergent_def
   sumset_inter_union_subset hC0ne
[PROOF STATE]
proof (prove)
using this:
card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer (sumset (A \<inter> B) (A \<union> B)))) \<le> card (sumset (A \<inter> B) (A \<union> B)) + card (stabilizer (sumset (A \<inter> B) (A \<union> B)))
convergent_set ?A ?B = {C. local.convergent C ?A ?B}
local.convergent ?C ?A ?B \<equiv> ?C \<subseteq> sumset ?A ?B \<and> ?C \<noteq> {} \<and> card (?A \<inter> ?B) + card (sumset (?A \<union> ?B) (stabilizer ?C)) \<le> card ?C + card (stabilizer ?C)
sumset (?A \<inter> ?B) (?A \<union> ?B) \<subseteq> sumset ?A ?B
sumset (A \<inter> B) (A \<union> B) \<noteq> {}

goal (1 subgoal):
 1. sumset (A \<inter> B) (A \<union> B) \<in> convergent_set A B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sumset (A \<inter> B) (A \<union> B) \<in> convergent_set A B

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sumset (A \<inter> B) (A \<union> B) \<in> convergent_set A B
[PROOF STEP]
have hconvergent_ne: "convergent_set A B \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
sumset (A \<inter> B) (A \<union> B) \<in> convergent_set A B

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

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define KS where "KS \<equiv> (\<lambda> X. card (stabilizer X)) ` convergent_set A B"
[PROOF STATE]
proof (state)
this:
KS \<equiv> (\<lambda>X. card (stabilizer X)) ` convergent_set A B

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define K where "K \<equiv> Min KS"
[PROOF STATE]
proof (state)
this:
K \<equiv> Min KS

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define C where "C \<equiv> @C. C \<in> convergent_set A B \<and> K = card (stabilizer C)"
[PROOF STATE]
proof (state)
this:
C \<equiv> SOME C. C \<in> convergent_set A B \<and> K = card (stabilizer C)

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain KS: "finite KS" "KS \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>finite KS; KS \<noteq> {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using hconvergent_ne finite_convergent_set assms KS_def
[PROOF STATE]
proof (prove)
using this:
convergent_set A B \<noteq> {}
\<lbrakk>finite ?A; finite ?B\<rbrakk> \<Longrightarrow> finite (convergent_set ?A ?B)
\<forall>m<n. \<forall>C D. C \<subseteq> G \<longrightarrow> D \<subseteq> G \<longrightarrow> finite C \<longrightarrow> finite D \<longrightarrow> C \<noteq> {} \<longrightarrow> D \<noteq> {} \<longrightarrow> card (sumset C D) + card C = m \<longrightarrow> card (sumset C (stabilizer (sumset C D))) + card (sumset D (stabilizer (sumset C D))) - card (stabilizer (sumset C D)) \<le> card (sumset C D)
A \<subseteq> G
B \<subseteq> G
finite A
finite B
A \<noteq> {}
A \<inter> B \<noteq> {}
card (sumset A B) + card A = n
card (A \<inter> B) < card A
KS \<equiv> (\<lambda>X. card (stabilizer X)) ` convergent_set A B

goal (1 subgoal):
 1. (\<lbrakk>finite KS; KS \<noteq> {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite KS
KS \<noteq> {}

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite KS
KS \<noteq> {}
[PROOF STEP]
have "K \<in> KS"
[PROOF STATE]
proof (prove)
using this:
finite KS
KS \<noteq> {}

goal (1 subgoal):
 1. K \<in> KS
[PROOF STEP]
using K_def Min_in
[PROOF STATE]
proof (prove)
using this:
finite KS
KS \<noteq> {}
K \<equiv> Min KS
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Min ?A \<in> ?A

goal (1 subgoal):
 1. K \<in> KS
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
K \<in> KS

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K \<in> KS
[PROOF STEP]
have "\<exists> X. X \<in> convergent_set A B \<and> K = card (stabilizer X)"
[PROOF STATE]
proof (prove)
using this:
K \<in> KS

goal (1 subgoal):
 1. \<exists>X. X \<in> convergent_set A B \<and> K = card (stabilizer X)
[PROOF STEP]
using KS_def
[PROOF STATE]
proof (prove)
using this:
K \<in> KS
KS \<equiv> (\<lambda>X. card (stabilizer X)) ` convergent_set A B

goal (1 subgoal):
 1. \<exists>X. X \<in> convergent_set A B \<and> K = card (stabilizer X)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>X. X \<in> convergent_set A B \<and> K = card (stabilizer X)

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>X. X \<in> convergent_set A B \<and> K = card (stabilizer X)
[PROOF STEP]
obtain "C \<in> convergent_set A B" and Keq: "K = card (stabilizer C)"
[PROOF STATE]
proof (prove)
using this:
\<exists>X. X \<in> convergent_set A B \<and> K = card (stabilizer X)

goal (1 subgoal):
 1. (\<lbrakk>C \<in> convergent_set A B; K = card (stabilizer C)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (mono_tags, lifting) C_def someI_ex)
[PROOF STATE]
proof (state)
this:
C \<in> convergent_set A B
K = card (stabilizer C)

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
C \<in> convergent_set A B
K = card (stabilizer C)
[PROOF STEP]
have hC: "C \<subseteq> sumset A B" and hCne: "C \<noteq> {}" and
    hCcard: "card C + card (stabilizer C) \<ge>
    card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer C))"
[PROOF STATE]
proof (prove)
using this:
C \<in> convergent_set A B
K = card (stabilizer C)

goal (1 subgoal):
 1. C \<subseteq> sumset A B &&& C \<noteq> {} &&& card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer C)) \<le> card C + card (stabilizer C)
[PROOF STEP]
using convergent_set_def convergent_def
[PROOF STATE]
proof (prove)
using this:
C \<in> convergent_set A B
K = card (stabilizer C)
convergent_set ?A ?B = {C. local.convergent C ?A ?B}
local.convergent ?C ?A ?B \<equiv> ?C \<subseteq> sumset ?A ?B \<and> ?C \<noteq> {} \<and> card (?A \<inter> ?B) + card (sumset (?A \<union> ?B) (stabilizer ?C)) \<le> card ?C + card (stabilizer ?C)

goal (1 subgoal):
 1. C \<subseteq> sumset A B &&& C \<noteq> {} &&& card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer C)) \<le> card C + card (stabilizer C)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C \<subseteq> sumset A B
C \<noteq> {}
card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer C)) \<le> card C + card (stabilizer C)

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have hCmin: "\<And> Y. Y \<in> convergent_set A B \<Longrightarrow>
    card (stabilizer Y) \<ge> card (stabilizer C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer C) \<le> card (stabilizer Y)
[PROOF STEP]
using K_def KS_def Keq Min_le KS(1)
[PROOF STATE]
proof (prove)
using this:
K \<equiv> Min KS
KS \<equiv> (\<lambda>X. card (stabilizer X)) ` convergent_set A B
K = card (stabilizer C)
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> Min ?A \<le> ?x
finite KS

goal (1 subgoal):
 1. \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer C) \<le> card (stabilizer Y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer C) \<le> card (stabilizer ?Y)

goal (1 subgoal):
 1. (\<And>X. \<lbrakk>local.convergent X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using hCmin hC hCcard hCne local.convergent_def that
[PROOF STATE]
proof (prove)
using this:
?Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer C) \<le> card (stabilizer ?Y)
C \<subseteq> sumset A B
card (A \<inter> B) + card (sumset (A \<union> B) (stabilizer C)) \<le> card C + card (stabilizer C)
C \<noteq> {}
local.convergent ?C ?A ?B \<equiv> ?C \<subseteq> sumset ?A ?B \<and> ?C \<noteq> {} \<and> card (?A \<inter> ?B) + card (sumset (?A \<union> ?B) (stabilizer ?C)) \<le> card ?C + card (stabilizer ?C)
\<lbrakk>local.convergent ?X A B; \<And>Y. Y \<in> convergent_set A B \<Longrightarrow> card (stabilizer ?X) \<le> card (stabilizer Y)\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diagonal_to_Smith_PQ':
  fixes A::"'a::{bezout_ring}^'cols::{mod_type}^'rows::{mod_type}"
  assumes A: "isDiagonal A" and ib: "is_bezout_ext bezout"
  assumes PBQ: "(P,S,Q) = diagonal_to_Smith_PQ A bezout"
  shows "S = P**A**Q \<and> invertible P \<and> invertible Q \<and> Smith_normal_form S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = P ** A ** Q \<and> invertible P \<and> invertible Q \<and> Smith_normal_form S
[PROOF STEP]
using A PBQ Smith_normal_form_diagonal_to_Smith diagonal_to_Smith_PQ ib
[PROOF STATE]
proof (prove)
using this:
isDiagonal A
(P, S, Q) = diagonal_to_Smith_PQ A bezout
\<lbrakk>is_bezout_ext ?bezout; isDiagonal ?A\<rbrakk> \<Longrightarrow> Smith_normal_form (diagonal_to_Smith ?A ?bezout)
\<lbrakk>isDiagonal ?A; is_bezout_ext ?bezout; (?P, ?B, ?Q) = diagonal_to_Smith_PQ ?A ?bezout\<rbrakk> \<Longrightarrow> ?B = ?P ** ?A ** ?Q \<and> invertible ?P \<and> invertible ?Q \<and> ?B = diagonal_to_Smith ?A ?bezout
is_bezout_ext bezout

goal (1 subgoal):
 1. S = P ** A ** Q \<and> invertible P \<and> invertible Q \<and> Smith_normal_form S
[PROOF STEP]
by fastforce


[STATEMENT]
lemma is_word_append[simp]: "is_word (a@b) = (is_word a \<and> is_word b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_word (a @ b) = (is_word a \<and> is_word b)
[PROOF STEP]
by (auto simp add: is_word_def)


[STATEMENT]
lemma in_fst_image: "a \<in> fst ` AB \<longleftrightarrow> (\<exists>b. (a,b) \<in> AB)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> fst ` AB) = (\<exists>b. (a, b) \<in> AB)
[PROOF STEP]
by force


[STATEMENT]
lemma robdd_unique :
assumes "robdd_invar b1"
    and "robdd_invar b2"
    and "robdd_invar_ids bs"
    and "b1 \<in> bs" "b2 \<in> bs"
shows "robdd_\<alpha> b1 = robdd_\<alpha> b2 \<longleftrightarrow> b1 = b2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (robdd_\<alpha> b1 = robdd_\<alpha> b2) = (b1 = b2)
[PROOF STEP]
using robdd_equiv_alt_def [OF assms(1,2)]
      robdd_invar_ids_equiv_implies_eq[of bs, OF assms(3,4,5)]
[PROOF STATE]
proof (prove)
using this:
robdd_equiv b1 b2 = (robdd_\<alpha> b1 = robdd_\<alpha> b2)
robdd_equiv b1 b2 \<Longrightarrow> b1 = b2

goal (1 subgoal):
 1. (robdd_\<alpha> b1 = robdd_\<alpha> b2) = (b1 = b2)
[PROOF STEP]
by blast


[STATEMENT]
lemma lvl_insert: obtains
  (Same) "lvl (insert x t) = lvl t" |
  (Incr) "lvl (insert x t) = lvl t + 1" "sngl (insert x t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lvl (insert x t) = lvl t \<Longrightarrow> thesis; \<lbrakk>lvl (insert x t) = lvl t + 1; sngl (insert x t)\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using lvl_insert_aux
[PROOF STATE]
proof (prove)
using this:
lvl (insert ?x ?t) = lvl ?t \<or> lvl (insert ?x ?t) = lvl ?t + 1 \<and> sngl (insert ?x ?t)

goal (1 subgoal):
 1. \<lbrakk>lvl (insert x t) = lvl t \<Longrightarrow> thesis; \<lbrakk>lvl (insert x t) = lvl t + 1; sngl (insert x t)\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma homeomorphic_space_imp_isomorphic_reduced_homology_groups:
   "X homeomorphic_space Y \<Longrightarrow> reduced_homology_group p X \<cong> reduced_homology_group p Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X homeomorphic_space Y \<Longrightarrow> reduced_homology_group p X \<cong> reduced_homology_group p Y
[PROOF STEP]
by (simp add: homeomorphic_imp_homotopy_equivalent_space homotopy_equivalent_space_imp_isomorphic_reduced_homology_groups)


[STATEMENT]
lemma diff_Suc:"(n::nat) \<le> m \<Longrightarrow> m - n + Suc 0 = Suc m - n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> m \<Longrightarrow> m - n + Suc 0 = Suc m - n
[PROOF STEP]
by arith


[STATEMENT]
lemma fps_unit_factor_mult_fps_X:
  fixes f :: "'a::{comm_monoid_add,monoid_mult,mult_zero} fps"
  shows "unit_factor (fps_X * f) = unit_factor f"
  and   "unit_factor (f * fps_X) = unit_factor f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor (fps_X * f) = unit_factor f &&& unit_factor (f * fps_X) = unit_factor f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. unit_factor (fps_X * f) = unit_factor f
 2. unit_factor (f * fps_X) = unit_factor f
[PROOF STEP]
show "unit_factor (fps_X * f) = unit_factor f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor (fps_X * f) = unit_factor f
[PROOF STEP]
by (cases "f=0") (auto intro: fps_ext simp: fps_subdegree_mult_fps_X(1))
[PROOF STATE]
proof (state)
this:
unit_factor (fps_X * f) = unit_factor f

goal (1 subgoal):
 1. unit_factor (f * fps_X) = unit_factor f
[PROOF STEP]
thus "unit_factor (f * fps_X) = unit_factor f"
[PROOF STATE]
proof (prove)
using this:
unit_factor (fps_X * f) = unit_factor f

goal (1 subgoal):
 1. unit_factor (f * fps_X) = unit_factor f
[PROOF STEP]
by (simp add: fps_mult_fps_X_commute)
[PROOF STATE]
proof (state)
this:
unit_factor (f * fps_X) = unit_factor f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_coneToFun:
    shows "bij_betw coneToFun (cones S.unity) (S.PiE' I (S.set o D))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw coneToFun (cones S.unity) (Pi I (S.set \<circ> D) \<inter> S.extensional' I)
[PROOF STEP]
using coneToFun_mapsto funToCone_mapsto funToCone_coneToFun coneToFun_funToCone
            bij_betwI
[PROOF STATE]
proof (prove)
using this:
coneToFun \<in> cones S.unity \<rightarrow> Pi I (S.set \<circ> D) \<inter> S.extensional' I
funToCone \<in> Pi I (S.set \<circ> D) \<inter> S.extensional' I \<rightarrow> cones S.unity
?\<chi> \<in> cones S.unity \<Longrightarrow> funToCone (coneToFun ?\<chi>) = ?\<chi>
?F \<in> Pi I (S.set \<circ> D) \<inter> S.extensional' I \<Longrightarrow> coneToFun (funToCone ?F) = ?F
\<lbrakk>?f \<in> ?A \<rightarrow> ?B; ?g \<in> ?B \<rightarrow> ?A; \<And>x. x \<in> ?A \<Longrightarrow> ?g (?f x) = x; \<And>y. y \<in> ?B \<Longrightarrow> ?f (?g y) = y\<rbrakk> \<Longrightarrow> bij_betw ?f ?A ?B

goal (1 subgoal):
 1. bij_betw coneToFun (cones S.unity) (Pi I (S.set \<circ> D) \<inter> S.extensional' I)
[PROOF STEP]
by blast


[STATEMENT]
lemma dvd_associated2:
  fixes a::"'a::idom"
  assumes ab: "a dvd b" and ba: "b dvd a" and a: "a\<noteq>0"
  shows "\<exists>u. u dvd 1 \<and> a = u*b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u. u dvd (1::'a) \<and> a = u * b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u. u dvd (1::'a) \<and> a = u * b
[PROOF STEP]
obtain k where a_kb: "a = k*b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. a = k * b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ab
[PROOF STATE]
proof (prove)
using this:
a dvd b

goal (1 subgoal):
 1. (\<And>k. a = k * b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. b = a * k

goal (1 subgoal):
 1. (\<And>k. a = k * b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Groups.mult_ac(2) ba dvdE)
[PROOF STATE]
proof (state)
this:
a = k * b

goal (1 subgoal):
 1. \<exists>u. u dvd (1::'a) \<and> a = u * b
[PROOF STEP]
obtain q where b_qa: "b = q*a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>q. b = q * a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ba
[PROOF STATE]
proof (prove)
using this:
b dvd a

goal (1 subgoal):
 1. (\<And>q. b = q * a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. a = b * k

goal (1 subgoal):
 1. (\<And>q. b = q * a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Groups.mult_ac(2) ab dvdE)
[PROOF STATE]
proof (state)
this:
b = q * a

goal (1 subgoal):
 1. \<exists>u. u dvd (1::'a) \<and> a = u * b
[PROOF STEP]
have 1: "a = k*q*a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = k * q * a
[PROOF STEP]
using a_kb b_qa
[PROOF STATE]
proof (prove)
using this:
a = k * b
b = q * a

goal (1 subgoal):
 1. a = k * q * a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = k * q * a

goal (1 subgoal):
 1. \<exists>u. u dvd (1::'a) \<and> a = u * b
[PROOF STEP]
hence "k*q = 1"
[PROOF STATE]
proof (prove)
using this:
a = k * q * a

goal (1 subgoal):
 1. k * q = (1::'a)
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
a = k * q * a
a \<noteq> (0::'a)

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

goal (1 subgoal):
 1. \<exists>u. u dvd (1::'a) \<and> a = u * b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
k * q = (1::'a)

goal (1 subgoal):
 1. \<exists>u. u dvd (1::'a) \<and> a = u * b
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
k * q = (1::'a)
a = k * q * a

goal (1 subgoal):
 1. \<exists>u. u dvd (1::'a) \<and> a = u * b
[PROOF STEP]
by (metis a_kb dvd_triv_left)
[PROOF STATE]
proof (state)
this:
\<exists>u. u dvd (1::'a) \<and> a = u * b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma not_UNIV_le_Iic[simp]: "\<not> UNIV \<subseteq> {..\<le>\<^sub>ah}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> UNIV \<subseteq> {..\<le>\<^sub>ah}
[PROOF STEP]
using gt_ex[of h]
[PROOF STATE]
proof (prove)
using this:
\<exists>y. h <\<^sub>a y

goal (1 subgoal):
 1. \<not> UNIV \<subseteq> {..\<le>\<^sub>ah}
[PROOF STEP]
by (auto simp: less_le_not_le)


[STATEMENT]
lemma (in CL) isLub_upper: "[|isLub S cl L; y \<in> S|] ==> (y, L) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isLub S cl L; y \<in> S\<rbrakk> \<Longrightarrow> (y, L) \<in> r
[PROOF STEP]
by (simp add: isLub_def r_def)