[STATEMENT]
lemma numeral_octo_conv_of_nat: "numeral x = octo_of_nat (numeral x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral x = octo_of_nat (numeral x)
[PROOF STEP]
proof (induction x)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit0 x) = octo_of_nat (numeral (num.Bit0 x))
 3. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
case(Bit0 x)
[PROOF STATE]
proof (state)
this:
numeral x = octo_of_nat (numeral x)

goal (3 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit0 x) = octo_of_nat (numeral (num.Bit0 x))
 3. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
have "numeral x+ numeral x = octo_of_nat(numeral x+ numeral x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral x + numeral x = octo_of_nat (numeral x + numeral x)
[PROOF STEP]
unfolding Bit0.IH octo_of_nat_add
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. octo_of_nat (numeral x) + octo_of_nat (numeral x) = octo_of_nat (numeral x) + octo_of_nat (numeral x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
numeral x + numeral x = octo_of_nat (numeral x + numeral x)

goal (3 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit0 x) = octo_of_nat (numeral (num.Bit0 x))
 3. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
numeral x + numeral x = octo_of_nat (numeral x + numeral x)

goal (1 subgoal):
 1. numeral (num.Bit0 x) = octo_of_nat (numeral (num.Bit0 x))
[PROOF STEP]
by (simp add: numeral_Bit0)
[PROOF STATE]
proof (state)
this:
numeral (num.Bit0 x) = octo_of_nat (numeral (num.Bit0 x))

goal (2 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
case(Bit1 x)
[PROOF STATE]
proof (state)
this:
numeral x = octo_of_nat (numeral x)

goal (2 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
have "numeral x+ numeral x + numeral num.One=
octo_of_nat (numeral x + numeral x + numeral num.One)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral x + numeral x + Numeral1 = octo_of_nat (numeral x + numeral x + Numeral1)
[PROOF STEP]
unfolding Bit1.IH octo_of_nat_add
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. octo_of_nat (numeral x) + octo_of_nat (numeral x) + Numeral1 = octo_of_nat (numeral x) + octo_of_nat (numeral x) + octo_of_nat Numeral1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
numeral x + numeral x + Numeral1 = octo_of_nat (numeral x + numeral x + Numeral1)

goal (2 subgoals):
 1. Numeral1 = octo_of_nat Numeral1
 2. \<And>x. numeral x = octo_of_nat (numeral x) \<Longrightarrow> numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
numeral x + numeral x + Numeral1 = octo_of_nat (numeral x + numeral x + Numeral1)

goal (1 subgoal):
 1. numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))
[PROOF STEP]
by (simp add: numeral_Bit1)
[PROOF STATE]
proof (state)
this:
numeral (num.Bit1 x) = octo_of_nat (numeral (num.Bit1 x))

goal (1 subgoal):
 1. Numeral1 = octo_of_nat Numeral1
[PROOF STEP]
qed auto


[STATEMENT]
lemma pi_approx_128:
  "abs (pi - 1069028584064966747859680373161870783301 / 2^128) \<le> inverse (2^128)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>pi - 1069028584064966747859680373161870783301 / 2 ^ 128\<bar> \<le> inverse (2 ^ 128)
[PROOF STEP]
by (rule approx_coarsen[OF pi_approx_54_decimals]) simp


[STATEMENT]
lemma l0_gr0[arith]: "l0 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
have "0 < 1/(f2*(e-1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / (f2 * (e - 1))
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
0 < 1 / (f2 * (e - 1))

goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < 1 / (f2 * (e - 1))

goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
note l0f2e
[PROOF STATE]
proof (state)
this:
1 / (f2 * (e - 1)) \<le> l0

goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < l0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < l0

goal (1 subgoal):
 1. 0 < l0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < l0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma merge_overlap_helper1: "interval_of A \<subseteq> (\<Union>s \<in> set ss. interval_of s) \<Longrightarrow>
      (\<Union>s \<in> set (merge_overlap A ss). interval_of s) = (\<Union>s \<in> set ss. interval_of s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_of A \<subseteq> \<Union> (interval_of ` set ss) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A ss)) = \<Union> (interval_of ` set ss)
[PROOF STEP]
apply(induction ss)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. interval_of A \<subseteq> \<Union> (interval_of ` set []) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A [])) = \<Union> (interval_of ` set [])
 2. \<And>a ss. \<lbrakk>interval_of A \<subseteq> \<Union> (interval_of ` set ss) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A ss)) = \<Union> (interval_of ` set ss); interval_of A \<subseteq> \<Union> (interval_of ` set (a # ss))\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A (a # ss))) = \<Union> (interval_of ` set (a # ss))
[PROOF STEP]
apply(simp; fail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ss. \<lbrakk>interval_of A \<subseteq> \<Union> (interval_of ` set ss) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A ss)) = \<Union> (interval_of ` set ss); interval_of A \<subseteq> \<Union> (interval_of ` set (a # ss))\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A (a # ss))) = \<Union> (interval_of ` set (a # ss))
[PROOF STEP]
apply(rename_tac x xs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>interval_of A \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A xs)) = \<Union> (interval_of ` set xs); interval_of A \<subseteq> \<Union> (interval_of ` set (x # xs))\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A (x # xs))) = \<Union> (interval_of ` set (x # xs))
[PROOF STEP]
apply(cases A, rename_tac a b)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b. \<lbrakk>interval_of A \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A xs)) = \<Union> (interval_of ` set xs); interval_of A \<subseteq> \<Union> (interval_of ` set (x # xs)); A = (a, b)\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A (x # xs))) = \<Union> (interval_of ` set (x # xs))
[PROOF STEP]
apply(case_tac x)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b aa ba. \<lbrakk>interval_of A \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A xs)) = \<Union> (interval_of ` set xs); interval_of A \<subseteq> \<Union> (interval_of ` set (x # xs)); A = (a, b); x = (aa, ba)\<rbrakk> \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap A (x # xs))) = \<Union> (interval_of ` set (x # xs))
[PROOF STEP]
apply(simp add: not_disjoint_intervals_def interval_of.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba)\<rbrakk> \<Longrightarrow> (\<not> disjoint {a..b} {aa..ba} \<longrightarrow> {min a aa..max b ba} \<union> \<Union> (interval_of ` set xs) = {aa..ba} \<union> \<Union> (interval_of ` set xs)) \<and> (disjoint {a..b} {aa..ba} \<longrightarrow> {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = {aa..ba} \<union> \<Union> (interval_of ` set xs))
[PROOF STEP]
apply(intro impI conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); \<not> disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {min a aa..max b ba} \<union> \<Union> (interval_of ` set xs) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
 2. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
[PROOF STEP]
apply(drule not_disjoint_union)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); {a..b} \<union> {aa..ba} = {min a aa..max b ba}\<rbrakk> \<Longrightarrow> {min a aa..max b ba} \<union> \<Union> (interval_of ` set xs) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
 2. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
[PROOF STEP]
apply(drule_tac C="(\<Union>x\<in>set xs. interval_of x)" in disjoint_subset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba)\<rbrakk> \<Longrightarrow> {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs)
 2. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<subseteq> \<Union> (interval_of ` set xs) \<Longrightarrow> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = \<Union> (interval_of ` set xs); {a..b} \<subseteq> {aa..ba} \<union> \<Union> (interval_of ` set xs); A = (a, b); x = (aa, ba); {a..b} \<subseteq> \<Union> (interval_of ` set xs)\<rbrakk> \<Longrightarrow> {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs)) = {aa..ba} \<union> \<Union> (interval_of ` set xs)
[PROOF STEP]
apply(simp_all)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem knowledge_equiv_eq: "knows A evs  \<union>
   {Key (priEK B), Key (priSK B), Key (shrK B)} \<union>
     {X. Notes B X \<in> set evs}
  =
  knows B evs \<union>
   {Key (priEK A), Key (priSK A), Key (shrK A)} \<union>
     {X. Notes A X \<in> set evs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. knows A evs \<union> {Key (priEK B), Key (priSK B), Key (shrK B)} \<union> {X. Notes B X \<in> set evs} = knows B evs \<union> {Key (priEK A), Key (priSK A), Key (shrK A)} \<union> {X. Notes A X \<in> set evs}
[PROOF STEP]
apply (force simp only: knowledge_eval)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


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

goal (1 subgoal):
 1. card G.face_cycle_sets - 1 + card ({segment G.face_cycle_succ a a', segment G.face_cycle_succ a' a, {}} - {{}}) = card G.face_cycle_sets
[PROOF STEP]
by (simp add: card_insert_if)


[STATEMENT]
lemma m_inv_mult_of:
"\<And>x. x \<in> carrier (mult_of R) \<Longrightarrow> m_inv (mult_of R) x = m_inv R x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier (mult_of R) \<Longrightarrow> inv\<^bsub>mult_of R\<^esub> x = inv x
[PROOF STEP]
using mult_of_is_Units units_of_inv
[PROOF STATE]
proof (prove)
using this:
mult_of R = units_of R
?x \<in> Units R \<Longrightarrow> inv\<^bsub>units_of R\<^esub> ?x = inv ?x

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (mult_of R) \<Longrightarrow> inv\<^bsub>mult_of R\<^esub> x = inv x
[PROOF STEP]
unfolding units_of_def
[PROOF STATE]
proof (prove)
using this:
mult_of R = \<lparr>carrier = Units R, mult = (\<otimes>), one = \<one>\<rparr>
?x \<in> Units R \<Longrightarrow> inv\<^bsub>\<lparr>carrier = Units R, mult = (\<otimes>), one = \<one>\<rparr>\<^esub> ?x = inv ?x

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (mult_of R) \<Longrightarrow> inv\<^bsub>mult_of R\<^esub> x = inv x
[PROOF STEP]
by simp


[STATEMENT]
lemma hypnat_of_nat_Suc [simp]: "hypnat_of_nat (Suc n) = hypnat_of_nat n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hypnat_of_nat (Suc n) = hypnat_of_nat n + 1
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma (in Module) mr_cos_sprod_distrib2:"\<lbrakk>submodule R M H;
 a \<in> carrier R; X \<in> set_mr_cos M H; Y \<in> set_mr_cos M H\<rbrakk> \<Longrightarrow>
 mr_cos_sprod M H a (mr_cospOp M H X Y) =
           mr_cospOp M H (mr_cos_sprod M H a X) (mr_cos_sprod M H a Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>submodule R M H; a \<in> carrier R; X \<in> set_mr_cos M H; Y \<in> set_mr_cos M H\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a (mr_cospOp M H X Y) = mr_cospOp M H (mr_cos_sprod M H a X) (mr_cos_sprod M H a Y)
[PROOF STEP]
apply (simp add:set_mr_cos_def, (erule bexE)+, rename_tac m n, simp,
       thin_tac "X = m \<uplus>\<^bsub>M\<^esub> H", thin_tac "Y = n \<uplus>\<^bsub>M\<^esub> H")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a (mr_cospOp M H (m \<uplus>\<^bsub>M\<^esub> H) (n \<uplus>\<^bsub>M\<^esub> H)) = mr_cospOp M H (mr_cos_sprod M H a (m \<uplus>\<^bsub>M\<^esub> H)) (mr_cos_sprod M H a (n \<uplus>\<^bsub>M\<^esub> H))
[PROOF STEP]
apply (subst mr_cos_sprodTr [of H], assumption+)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a (mr_cospOp M H (m \<uplus>\<^bsub>M\<^esub> H) (n \<uplus>\<^bsub>M\<^esub> H)) = mr_cospOp M H (a \<cdot>\<^sub>s m \<uplus>\<^bsub>M\<^esub> H) (a \<cdot>\<^sub>s n \<uplus>\<^bsub>M\<^esub> H)
[PROOF STEP]
apply (subst mr_cospOpTr, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a ((m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H) = mr_cospOp M H (a \<cdot>\<^sub>s m \<uplus>\<^bsub>M\<^esub> H) (a \<cdot>\<^sub>s n \<uplus>\<^bsub>M\<^esub> H)
[PROOF STEP]
apply (subst mr_cospOpTr, assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>s m \<in> carrier M
 2. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>s n \<in> carrier M
 3. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a ((m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H) = (a \<cdot>\<^sub>s m \<plusminus> a \<cdot>\<^sub>s n) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (simp add:sc_mem)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> mr_cos_sprod M H a ((m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H) = (a \<cdot>\<^sub>s m \<plusminus> a \<cdot>\<^sub>s n) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (subst mr_cos_sprodTr [of H], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> m \<plusminus> n \<in> carrier M
 2. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>s (m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H = (a \<cdot>\<^sub>s m \<plusminus> a \<cdot>\<^sub>s n) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (rule ag_pOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. \<lbrakk>submodule R M H; a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>s (m \<plusminus> n) \<uplus>\<^bsub>M\<^esub> H = (a \<cdot>\<^sub>s m \<plusminus> a \<cdot>\<^sub>s n) \<uplus>\<^bsub>M\<^esub> H
[PROOF STEP]
apply (simp add:sc_r_distr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma algebraic_int_sum [intro]:
  "(\<And>x. x \<in> A \<Longrightarrow> algebraic_int (f x :: 'a :: field_char_0))
    \<Longrightarrow> algebraic_int (sum f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> algebraic_int (f x)) \<Longrightarrow> algebraic_int (sum f A)
[PROOF STEP]
by (induction A rule: infinite_finite_induct) auto


[STATEMENT]
lemma map_upto_n_mod:
"(Poly (map f [0..<n]) mod qr_poly) = (Poly (map f [0..<n]) :: 'a mod_ring poly)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly (map f [0..<n]) mod qr_poly = Poly (map f [0..<n])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Poly (map f [0..<n]) mod qr_poly = Poly (map f [0..<n])
[PROOF STEP]
have "degree (Poly (map f [0::nat..<n])) < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (Poly (map f [0..<n])) < n
[PROOF STEP]
by (metis Suc_pred' deg_Poly' deg_qr_n deg_qr_pos degree_0 diff_zero le_imp_less_Suc
    length_map length_upt nat_int)
[PROOF STATE]
proof (state)
this:
degree (Poly (map f [0..<n])) < n

goal (1 subgoal):
 1. Poly (map f [0..<n]) mod qr_poly = Poly (map f [0..<n])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree (Poly (map f [0..<n])) < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree (Poly (map f [0..<n])) < n

goal (1 subgoal):
 1. Poly (map f [0..<n]) mod qr_poly = Poly (map f [0..<n])
[PROOF STEP]
by (subst deg_mod_qr_poly, use deg_qr_n in \<open>auto\<close>)
[PROOF STATE]
proof (state)
this:
Poly (map f [0..<n]) mod qr_poly = Poly (map f [0..<n])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma union_ring_carrier: "carrier (union_ring C) = (\<Union>(carrier ` C))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (union_ring C) = \<Union> (carrier ` C)
[PROOF STEP]
unfolding union_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier \<lparr>carrier = \<Union> (carrier ` C), monoid.mult = \<lambda>a b. a \<otimes>\<^bsub>SOME R. R \<in> C \<and> a \<in> carrier R \<and> b \<in> carrier R\<^esub> b, one = \<one>\<^bsub>SOME R. R \<in> C\<^esub>, zero = \<zero>\<^bsub>SOME R. R \<in> C\<^esub>, add = \<lambda>a b. a \<oplus>\<^bsub>SOME R. R \<in> C \<and> a \<in> carrier R \<and> b \<in> carrier R\<^esub> b\<rparr> = \<Union> (carrier ` C)
[PROOF STEP]
by simp


[STATEMENT]
lemma dim_row_of_cjn_prod [simp]:
  "dim_row ((M\<^sup>\<star>) * (N\<^sup>\<star>)) = dim_row M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (M\<^sup>\<star> * N\<^sup>\<star>) = dim_row M
[PROOF STEP]
by (simp add: cpx_mat_cnj_def)


[STATEMENT]
lemma intvs_ii_incdec:
  fixes l h :: int
  shows "l\<le>h+1 \<Longrightarrow> {l..h+1} = insert (h+1) {l..h}"
    and "l-1\<le>h \<Longrightarrow> {l-1..h} = insert (l-1) {l..h}"
    and "{l+1..h} = {l..h} - {l}"
    and "{l..h-1} = {l..h} - {h}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((l \<le> h + 1 \<Longrightarrow> {l..h + 1} = insert (h + 1) {l..h}) &&& (l - 1 \<le> h \<Longrightarrow> {l - 1..h} = insert (l - 1) {l..h})) &&& {l + 1..h} = {l..h} - {l} &&& {l..h - 1} = {l..h} - {h}
[PROOF STEP]
by auto


[STATEMENT]
lemma map_nebset_nebsingleton: "map_nebset f (nebsingleton x) = nebsingleton (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_nebset f (nebsingleton x) = nebsingleton (f x)
[PROOF STEP]
by transfer auto


[STATEMENT]
lemma set_spmf_I_N:
  assumes "((N,e),d) \<in> set_spmf I"
  obtains P Q where "N = P * Q"
    and "P \<noteq> Q"
    and "prime P"
    and "prime Q"
    and "coprime e ((P - 1)*(Q - 1))"
    and "d = nat (fst (bezw e ((P-1)*(Q-1))) mod int ((P-1)*(Q-1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P Q. \<lbrakk>N = P * Q; P \<noteq> Q; prime P; prime Q; coprime e ((P - 1) * (Q - 1)); d = nat (fst (bezw e ((P - 1) * (Q - 1))) mod int ((P - 1) * (Q - 1)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
((N, e), d) \<in> set_spmf I

goal (1 subgoal):
 1. (\<And>P Q. \<lbrakk>N = P * Q; P \<noteq> Q; prime P; prime Q; coprime e ((P - 1) * (Q - 1)); d = nat (fst (bezw e ((P - 1) * (Q - 1))) mod int ((P - 1) * (Q - 1)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply(auto simp add: I_def Let_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>\<And>P Q. \<lbrakk>x * xa = P * Q; P \<noteq> Q; prime P; prime Q; coprime e (P - Suc 0) \<and> coprime e (Q - Suc 0); nat (fst (bezw e ((x - Suc 0) * (xa - Suc 0))) mod (int (x - Suc 0) * int (xa - Suc 0))) = nat (fst (bezw e ((P - Suc 0) * (Q - Suc 0))) mod (int (P - Suc 0) * int (Q - Suc 0)))\<rbrakk> \<Longrightarrow> thesis; x \<in> set_spmf sample_primes; xa \<in> set_spmf (sample_set_excl prime_set {x}); N = x * xa; e \<in> set_spmf (sample_coprime ((x - Suc 0) * (xa - Suc 0))); d = nat (fst (bezw e ((x - Suc 0) * (xa - Suc 0))) mod (int (x - Suc 0) * int (xa - Suc 0)))\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using finite_prime_set mem_samp_primes_prime sample_set_excl_def rsa_base_axioms sample_primes_def
[PROOF STATE]
proof (prove)
using this:
finite prime_set
?x \<in> set_spmf sample_primes \<Longrightarrow> prime ?x
sample_set_excl ?Q ?P = spmf_of_set (?Q - ?P)
rsa_base prime_set
sample_primes = spmf_of_set prime_set

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>\<And>P Q. \<lbrakk>x * xa = P * Q; P \<noteq> Q; prime P; prime Q; coprime e (P - Suc 0) \<and> coprime e (Q - Suc 0); nat (fst (bezw e ((x - Suc 0) * (xa - Suc 0))) mod (int (x - Suc 0) * int (xa - Suc 0))) = nat (fst (bezw e ((P - Suc 0) * (Q - Suc 0))) mod (int (P - Suc 0) * int (Q - Suc 0)))\<rbrakk> \<Longrightarrow> thesis; x \<in> set_spmf sample_primes; xa \<in> set_spmf (sample_set_excl prime_set {x}); N = x * xa; e \<in> set_spmf (sample_coprime ((x - Suc 0) * (xa - Suc 0))); d = nat (fst (bezw e ((x - Suc 0) * (xa - Suc 0))) mod (int (x - Suc 0) * int (xa - Suc 0)))\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (simp add: set_spmf_sample_coprime)


[STATEMENT]
lemma llist_all2_lSupI:
  assumes "Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y" "\<forall>(xs, ys)\<in>Y. llist_all2 P xs ys"
  shows "llist_all2 P (lSup (fst ` Y)) (lSup (snd ` Y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llist_all2 P (lSup (fst ` Y)) (lSup (snd ` Y))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y
\<forall>(xs, ys)\<in>Y. llist_all2 P xs ys

goal (1 subgoal):
 1. llist_all2 P (lSup (fst ` Y)) (lSup (snd ` Y))
[PROOF STEP]
proof(coinduction arbitrary: Y)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y\<rbrakk> \<Longrightarrow> lnull (lSup (fst ` Y)) = lnull (lSup (snd ` Y))
 2. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
case LNil
[PROOF STATE]
proof (state)
this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y
\<forall>(x, y)\<in>Y. llist_all2 P x y

goal (2 subgoals):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y\<rbrakk> \<Longrightarrow> lnull (lSup (fst ` Y)) = lnull (lSup (snd ` Y))
 2. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y
\<forall>(x, y)\<in>Y. llist_all2 P x y

goal (1 subgoal):
 1. lnull (lSup (fst ` Y)) = lnull (lSup (snd ` Y))
[PROOF STEP]
by(auto dest: llist_all2_lnullD simp add: split_beta)
[PROOF STATE]
proof (state)
this:
lnull (lSup (fst ` Y)) = lnull (lSup (snd ` Y))

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
case (LCons Y)
[PROOF STATE]
proof (state)
this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y
\<forall>(x, y)\<in>Y. llist_all2 P x y
\<not> lnull (lSup (fst ` Y))
\<not> lnull (lSup (snd ` Y))

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
note chain = \<open>Complete_Partial_Order.chain _ Y\<close>
[PROOF STATE]
proof (state)
this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
from LCons
[PROOF STATE]
proof (chain)
picking this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y
\<forall>(x, y)\<in>Y. llist_all2 P x y
\<not> lnull (lSup (fst ` Y))
\<not> lnull (lSup (snd ` Y))
[PROOF STEP]
have Y: "\<And>xs ys. (xs, ys) \<in> Y \<Longrightarrow> llist_all2 P xs ys"
[PROOF STATE]
proof (prove)
using this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y
\<forall>(x, y)\<in>Y. llist_all2 P x y
\<not> lnull (lSup (fst ` Y))
\<not> lnull (lSup (snd ` Y))

goal (1 subgoal):
 1. \<And>xs ys. (xs, ys) \<in> Y \<Longrightarrow> llist_all2 P xs ys
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(?xs, ?ys) \<in> Y \<Longrightarrow> llist_all2 P ?xs ?ys

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
from LCons
[PROOF STATE]
proof (chain)
picking this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y
\<forall>(x, y)\<in>Y. llist_all2 P x y
\<not> lnull (lSup (fst ` Y))
\<not> lnull (lSup (snd ` Y))
[PROOF STEP]
obtain xs ys where xsysY: "(xs, ys) \<in> Y"
    and [simp]: "\<not> lnull xs" "\<not> lnull ys"
[PROOF STATE]
proof (prove)
using this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y
\<forall>(x, y)\<in>Y. llist_all2 P x y
\<not> lnull (lSup (fst ` Y))
\<not> lnull (lSup (snd ` Y))

goal (1 subgoal):
 1. (\<And>xs ys. \<lbrakk>(xs, ys) \<in> Y; \<not> lnull xs; \<not> lnull ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto 4 3 dest: llist_all2_lnullD simp add: split_beta)
[PROOF STATE]
proof (state)
this:
(xs, ys) \<in> Y
\<not> lnull xs
\<not> lnull ys

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
from xsysY
[PROOF STATE]
proof (chain)
picking this:
(xs, ys) \<in> Y
[PROOF STEP]
have "lhd xs \<in> lhd ` (fst ` Y \<inter> {xs. \<not> lnull xs})"
[PROOF STATE]
proof (prove)
using this:
(xs, ys) \<in> Y

goal (1 subgoal):
 1. lhd xs \<in> lhd ` (fst ` Y \<inter> {xs. \<not> lnull xs})
[PROOF STEP]
by(auto intro: rev_image_eqI)
[PROOF STATE]
proof (state)
this:
lhd xs \<in> lhd ` (fst ` Y \<inter> {xs. \<not> lnull xs})

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
hence "(THE x. x \<in> lhd ` (fst ` Y \<inter> {xs. \<not> lnull xs})) = lhd xs"
[PROOF STATE]
proof (prove)
using this:
lhd xs \<in> lhd ` (fst ` Y \<inter> {xs. \<not> lnull xs})

goal (1 subgoal):
 1. (THE x. x \<in> lhd ` (fst ` Y \<inter> {xs. \<not> lnull xs})) = lhd xs
[PROOF STEP]
by(rule the_equality)(auto dest!: lprefix_lhdD chainD[OF chain xsysY])
[PROOF STATE]
proof (state)
this:
(THE x. x \<in> lhd ` (fst ` Y \<inter> {xs. \<not> lnull xs})) = lhd xs

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(THE x. x \<in> lhd ` (fst ` Y \<inter> {xs. \<not> lnull xs})) = lhd xs

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
from xsysY
[PROOF STATE]
proof (chain)
picking this:
(xs, ys) \<in> Y
[PROOF STEP]
have "lhd ys \<in> lhd ` (snd ` Y \<inter> {xs. \<not> lnull xs})"
[PROOF STATE]
proof (prove)
using this:
(xs, ys) \<in> Y

goal (1 subgoal):
 1. lhd ys \<in> lhd ` (snd ` Y \<inter> {xs. \<not> lnull xs})
[PROOF STEP]
by(auto intro: rev_image_eqI)
[PROOF STATE]
proof (state)
this:
lhd ys \<in> lhd ` (snd ` Y \<inter> {xs. \<not> lnull xs})

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
hence "(THE x. x \<in> lhd ` (snd ` Y \<inter> {xs. \<not> lnull xs})) = lhd ys"
[PROOF STATE]
proof (prove)
using this:
lhd ys \<in> lhd ` (snd ` Y \<inter> {xs. \<not> lnull xs})

goal (1 subgoal):
 1. (THE x. x \<in> lhd ` (snd ` Y \<inter> {xs. \<not> lnull xs})) = lhd ys
[PROOF STEP]
by(rule the_equality)(auto dest!: lprefix_lhdD chainD[OF chain xsysY])
[PROOF STATE]
proof (state)
this:
(THE x. x \<in> lhd ` (snd ` Y \<inter> {xs. \<not> lnull xs})) = lhd ys

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(THE x. x \<in> lhd ` (snd ` Y \<inter> {xs. \<not> lnull xs})) = lhd ys

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
from xsysY
[PROOF STATE]
proof (chain)
picking this:
(xs, ys) \<in> Y
[PROOF STEP]
have "llist_all2 P xs ys"
[PROOF STATE]
proof (prove)
using this:
(xs, ys) \<in> Y

goal (1 subgoal):
 1. llist_all2 P xs ys
[PROOF STEP]
by(rule Y)
[PROOF STATE]
proof (state)
this:
llist_all2 P xs ys

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
hence "P (lhd xs) (lhd ys)"
[PROOF STATE]
proof (prove)
using this:
llist_all2 P xs ys

goal (1 subgoal):
 1. P (lhd xs) (lhd ys)
[PROOF STEP]
by(rule llist_all2_lhdD) simp
[PROOF STATE]
proof (state)
this:
P (lhd xs) (lhd ys)

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(THE x. x \<in> lhd ` (fst ` Y \<inter> {xs. \<not> lnull xs})) = lhd xs
(THE x. x \<in> lhd ` (snd ` Y \<inter> {xs. \<not> lnull xs})) = lhd ys
P (lhd xs) (lhd ys)
[PROOF STEP]
have ?lhd
[PROOF STATE]
proof (prove)
using this:
(THE x. x \<in> lhd ` (fst ` Y \<inter> {xs. \<not> lnull xs})) = lhd xs
(THE x. x \<in> lhd ` (snd ` Y \<inter> {xs. \<not> lnull xs})) = lhd ys
P (lhd xs) (lhd ys)

goal (1 subgoal):
 1. P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y)))
[PROOF STEP]
using LCons
[PROOF STATE]
proof (prove)
using this:
(THE x. x \<in> lhd ` (fst ` Y \<inter> {xs. \<not> lnull xs})) = lhd xs
(THE x. x \<in> lhd ` (snd ` Y \<inter> {xs. \<not> lnull xs})) = lhd ys
P (lhd xs) (lhd ys)
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y
\<forall>(x, y)\<in>Y. llist_all2 P x y
\<not> lnull (lSup (fst ` Y))
\<not> lnull (lSup (snd ` Y))

goal (1 subgoal):
 1. P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y)))

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y)))

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y)))

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
let ?Y = "map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys})"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
have "Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) ?Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) (map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys}))
[PROOF STEP]
by(rule chainI)(auto 4 3 dest: Y chainD[OF chain] intro: lprefix_ltlI)
[PROOF STATE]
proof (state)
this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) (map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys}))

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) (map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys}))

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
have "ltl ` (fst ` Y \<inter> {xs. \<not> lnull xs}) = fst ` ?Y"
      and "ltl ` (snd ` Y \<inter> {xs. \<not> lnull xs}) = snd ` ?Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ltl ` (fst ` Y \<inter> {xs. \<not> lnull xs}) = fst ` map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys}) &&& ltl ` (snd ` Y \<inter> {xs. \<not> lnull xs}) = snd ` map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys})
[PROOF STEP]
by(fastforce simp add: image_image dest: Y llist_all2_lnullD intro: rev_image_eqI)+
[PROOF STATE]
proof (state)
this:
ltl ` (fst ` Y \<inter> {xs. \<not> lnull xs}) = fst ` map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys})
ltl ` (snd ` Y \<inter> {xs. \<not> lnull xs}) = snd ` map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys})

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) (map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys}))
ltl ` (fst ` Y \<inter> {xs. \<not> lnull xs}) = fst ` map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys})
ltl ` (snd ` Y \<inter> {xs. \<not> lnull xs}) = snd ` map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys})
[PROOF STEP]
have ?ltl
[PROOF STATE]
proof (prove)
using this:
Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) (map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys}))
ltl ` (fst ` Y \<inter> {xs. \<not> lnull xs}) = fst ` map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys})
ltl ` (snd ` Y \<inter> {xs. \<not> lnull xs}) = snd ` map_prod ltl ltl ` (Y \<inter> {(xs, ys). \<not> lnull xs \<and> \<not> lnull ys})

goal (1 subgoal):
 1. (\<exists>Y. ltl (lSup (fst ` Y)) = lSup (fst ` Y) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Y) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y \<and> (\<forall>(x, y)\<in>Y. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y)))
[PROOF STEP]
by(auto 4 3 intro: llist_all2_ltlI dest: Y)
[PROOF STATE]
proof (state)
this:
(\<exists>Y. ltl (lSup (fst ` Y)) = lSup (fst ` Y) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Y) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y \<and> (\<forall>(x, y)\<in>Y. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y)))

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(\<exists>Y. ltl (lSup (fst ` Y)) = lSup (fst ` Y) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Y) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y \<and> (\<forall>(x, y)\<in>Y. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y)))

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y; \<forall>(x, y)\<in>Y. llist_all2 P x y; \<not> lnull (lSup (fst ` Y)); \<not> lnull (lSup (snd ` Y))\<rbrakk> \<Longrightarrow> P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Ya. ltl (lSup (fst ` Y)) = lSup (fst ` Ya) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Ya) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Ya \<and> (\<forall>(x, y)\<in>Ya. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y)))
(\<exists>Y. ltl (lSup (fst ` Y)) = lSup (fst ` Y) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Y) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y \<and> (\<forall>(x, y)\<in>Y. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y)))
(\<exists>Y. ltl (lSup (fst ` Y)) = lSup (fst ` Y) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Y) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y \<and> (\<forall>(x, y)\<in>Y. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y)))

goal (1 subgoal):
 1. P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Y. ltl (lSup (fst ` Y)) = lSup (fst ` Y) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Y) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y \<and> (\<forall>(x, y)\<in>Y. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
P (lhd (lSup (fst ` Y))) (lhd (lSup (snd ` Y))) \<and> ((\<exists>Y. ltl (lSup (fst ` Y)) = lSup (fst ` Y) \<and> ltl (lSup (snd ` Y)) = lSup (snd ` Y) \<and> Complete_Partial_Order.chain (rel_prod (\<sqsubseteq>) (\<sqsubseteq>)) Y \<and> (\<forall>(x, y)\<in>Y. llist_all2 P x y)) \<or> llist_all2 P (ltl (lSup (fst ` Y))) (ltl (lSup (snd ` Y))))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diagonal_to_Smith_aux_PQ:
  assumes P'B'Q': "(P',B',Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P,B,Q)"
  and diag: "isDiagonal B" and k:"k<min (nrows A) (ncols A)"
shows "B' = P'**A**Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout
[PROOF STEP]
using k P'B'Q' P Q PAQ diag
[PROOF STATE]
proof (prove)
using this:
k < min (nrows A) (ncols A)
(P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q)
invertible P
invertible Q
P ** A ** Q = B
isDiagonal B

goal (1 subgoal):
 1. B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout
[PROOF STEP]
proof (induct k arbitrary: P B Q P' Q' B')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>P B Q P' Q' B'. \<lbrakk>0 < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<0] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<0] bezout
 2. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < min (nrows A) (ncols A)
(P', B', Q') = diagonal_to_Smith_aux_PQ [0..<0] bezout (P, B, Q)
invertible P
invertible Q
P ** A ** Q = B
isDiagonal B

goal (2 subgoals):
 1. \<And>P B Q P' Q' B'. \<lbrakk>0 < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<0] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<0] bezout
 2. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < min (nrows A) (ncols A)
(P', B', Q') = diagonal_to_Smith_aux_PQ [0..<0] bezout (P, B, Q)
invertible P
invertible Q
P ** A ** Q = B
isDiagonal B
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < min (nrows A) (ncols A)
(P', B', Q') = diagonal_to_Smith_aux_PQ [0..<0] bezout (P, B, Q)
invertible P
invertible Q
P ** A ** Q = B
isDiagonal B

goal (1 subgoal):
 1. B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<0] bezout
[PROOF STEP]
using P Q PAQ
[PROOF STATE]
proof (prove)
using this:
0 < min (nrows A) (ncols A)
(P', B', Q') = diagonal_to_Smith_aux_PQ [0..<0] bezout (P, B, Q)
invertible P
invertible Q
P ** A ** Q = B
isDiagonal B
invertible P
invertible Q
P ** A ** Q = B

goal (1 subgoal):
 1. B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<0] bezout
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<0] bezout

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
case (Suc k P B Q P' Q' B')
[PROOF STATE]
proof (state)
this:
\<lbrakk>k < min (nrows A) (ncols A); (?P', ?B', ?Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (?P, ?B, ?Q); invertible ?P; invertible ?Q; ?P ** A ** ?Q = ?B; isDiagonal ?B\<rbrakk> \<Longrightarrow> ?B' = ?P' ** A ** ?Q' \<and> invertible ?P' \<and> invertible ?Q' \<and> ?B' = diagonal_to_Smith_aux ?B [0..<k] bezout
Suc k < min (nrows A) (ncols A)
(P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q)
invertible P
invertible Q
P ** A ** Q = B
isDiagonal B

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
note Suc_k = Suc.prems(1)
[PROOF STATE]
proof (state)
this:
Suc k < min (nrows A) (ncols A)

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
note PBQ = Suc.prems(2)
[PROOF STATE]
proof (state)
this:
(P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q)

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
note P = Suc.prems(3)
[PROOF STATE]
proof (state)
this:
invertible P

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
note Q = Suc.prems(4)
[PROOF STATE]
proof (state)
this:
invertible Q

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
note PAQ_B = Suc.prems(5)
[PROOF STATE]
proof (state)
this:
P ** A ** Q = B

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
note diag_B = Suc.prems(6)
[PROOF STATE]
proof (state)
this:
isDiagonal B

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
let ?Dk = "(diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
let ?P' = "fst ?Dk"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
let ?B'="fst (snd ?Dk)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
let ?Q' = "snd (snd ?Dk)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
have k: "k<min (nrows A) (ncols A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < min (nrows A) (ncols A)
[PROOF STEP]
using Suc_k
[PROOF STATE]
proof (prove)
using this:
Suc k < min (nrows A) (ncols A)

goal (1 subgoal):
 1. k < min (nrows A) (ncols A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k < min (nrows A) (ncols A)

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
have hyp: "?B' = ?P' ** A ** ?Q' \<and> invertible ?P' \<and> invertible ?Q'
      \<and> ?B' = diagonal_to_Smith_aux B [0..<k] bezout"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)) ** A ** snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) \<and> invertible (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) \<and> invertible (snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))) \<and> fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = diagonal_to_Smith_aux B [0..<k] bezout
[PROOF STEP]
by (rule Suc.hyps[OF k _ P Q PAQ_B diag_B], auto simp add: PAQ_B)
[PROOF STATE]
proof (state)
this:
fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)) ** A ** snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) \<and> invertible (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) \<and> invertible (snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))) \<and> fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = diagonal_to_Smith_aux B [0..<k] bezout

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
have diag_B': "isDiagonal ?B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
[PROOF STEP]
by (metis diag_B hyp ib isDiagonal_diagonal_to_Smith_aux k ncols_def nrows_def)
[PROOF STATE]
proof (state)
this:
isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
have "B' = diagonal_to_Smith_aux B [0..<Suc k] bezout"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
by (auto, metis Diagonal_to_Smith_row_i_PQ_eq PAQ_B Suc(3) diag_B'
        diagonal_to_Smith_aux_PQ_append2 eq_fst_iff hyp ib k sndI upt.simps(2) zero_order(1))
[PROOF STATE]
proof (state)
this:
B' = diagonal_to_Smith_aux B [0..<Suc k] bezout

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
B' = diagonal_to_Smith_aux B [0..<Suc k] bezout

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
have "B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q'
[PROOF STEP]
proof (rule Diagonal_to_Smith_row_i_PQ')
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. ?P ** A ** ?Q = ?B
 2. invertible ?P
 3. invertible ?Q
 4. is_bezout_ext ?bezout
 5. (P', B', Q') = Diagonal_to_Smith_row_i_PQ ?i ?bezout (?P, ?B, ?Q)
 6. isDiagonal ?B
 7. ?i < min (nrows A) (ncols A)
[PROOF STEP]
show "(P', B', Q') = Diagonal_to_Smith_row_i_PQ k bezout (?P',?B',?Q')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P', B', Q') = Diagonal_to_Smith_row_i_PQ k bezout (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)), fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))), snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
[PROOF STEP]
using Suc.prems
[PROOF STATE]
proof (prove)
using this:
Suc k < min (nrows A) (ncols A)
(P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q)
invertible P
invertible Q
P ** A ** Q = B
isDiagonal B

goal (1 subgoal):
 1. (P', B', Q') = Diagonal_to_Smith_row_i_PQ k bezout (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)), fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))), snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(P', B', Q') = Diagonal_to_Smith_row_i_PQ k bezout (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)), fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))), snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))

goal (6 subgoals):
 1. fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)) ** A ** snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))
 2. invertible (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))
 3. invertible (snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
 4. is_bezout_ext bezout
 5. isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
 6. k < min (nrows A) (ncols A)
[PROOF STEP]
show "invertible ?P'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))
[PROOF STEP]
using hyp
[PROOF STATE]
proof (prove)
using this:
fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)) ** A ** snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) \<and> invertible (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) \<and> invertible (snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))) \<and> fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = diagonal_to_Smith_aux B [0..<k] bezout

goal (1 subgoal):
 1. invertible (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
invertible (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))

goal (5 subgoals):
 1. fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)) ** A ** snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))
 2. invertible (snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
 3. is_bezout_ext bezout
 4. isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
 5. k < min (nrows A) (ncols A)
[PROOF STEP]
show "?P' ** A ** ?Q' = ?B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)) ** A ** snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))
[PROOF STEP]
using hyp
[PROOF STATE]
proof (prove)
using this:
fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)) ** A ** snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) \<and> invertible (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) \<and> invertible (snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))) \<and> fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = diagonal_to_Smith_aux B [0..<k] bezout

goal (1 subgoal):
 1. fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)) ** A ** snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)) ** A ** snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))

goal (4 subgoals):
 1. invertible (snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
 2. is_bezout_ext bezout
 3. isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
 4. k < min (nrows A) (ncols A)
[PROOF STEP]
show "invertible ?Q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
[PROOF STEP]
using hyp
[PROOF STATE]
proof (prove)
using this:
fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)) ** A ** snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) \<and> invertible (fst (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) \<and> invertible (snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q)))) \<and> fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))) = diagonal_to_Smith_aux B [0..<k] bezout

goal (1 subgoal):
 1. invertible (snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
invertible (snd (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))

goal (3 subgoals):
 1. is_bezout_ext bezout
 2. isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
 3. k < min (nrows A) (ncols A)
[PROOF STEP]
show "is_bezout_ext bezout"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_bezout_ext bezout
[PROOF STEP]
using ib
[PROOF STATE]
proof (prove)
using this:
is_bezout_ext bezout

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

goal (2 subgoals):
 1. isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
 2. k < min (nrows A) (ncols A)
[PROOF STEP]
show "k < min (nrows A) (ncols A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < min (nrows A) (ncols A)
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
k < min (nrows A) (ncols A)

goal (1 subgoal):
 1. k < min (nrows A) (ncols A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k < min (nrows A) (ncols A)

goal (1 subgoal):
 1. isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
[PROOF STEP]
show diag_B': "isDiagonal ?B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
[PROOF STEP]
using diag_B'
[PROOF STATE]
proof (prove)
using this:
isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))

goal (1 subgoal):
 1. isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isDiagonal (fst (snd (diagonal_to_Smith_aux_PQ [0..<k] bezout (P, P ** A ** Q, Q))))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q'

goal (1 subgoal):
 1. \<And>k P B Q P' Q' B'. \<lbrakk>\<And>P B Q P' Q' B'. \<lbrakk>k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<k] bezout; Suc k < min (nrows A) (ncols A); (P', B', Q') = diagonal_to_Smith_aux_PQ [0..<Suc k] bezout (P, B, Q); invertible P; invertible Q; P ** A ** Q = B; isDiagonal B\<rbrakk> \<Longrightarrow> B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q'
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q'

goal (1 subgoal):
 1. B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B' = P' ** A ** Q' \<and> invertible P' \<and> invertible Q' \<and> B' = diagonal_to_Smith_aux B [0..<Suc k] bezout

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powreal_gt_one: "a > 1 \<Longrightarrow> x > 0 \<Longrightarrow> a pow\<^sub>\<real> x > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> 1 < a pow\<^sub>\<real> x
[PROOF STEP]
by (metis less_eq_real_def powa_less_mono powa_zero_eq_one powreal_eq_powa)


[STATEMENT]
lemma dim_col_of_cjn_prod [simp]:
  "dim_col ((M\<^sup>\<star>) * (N\<^sup>\<star>)) = dim_col N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (M\<^sup>\<star> * N\<^sup>\<star>) = dim_col N
[PROOF STEP]
by (simp add: cpx_mat_cnj_def)


[STATEMENT]
lemma drae_image_dra_drae: "drae_image f (dra_drae A) = drae
    (alphabet A) (f (initial A))
    (\<Union> p \<in> nodes A. \<Union> a \<in> alphabet A. f ` {p} \<times> {a} \<times> f ` {transition A a p})
    (map (\<lambda> (P, Q). (f ` {p \<in> nodes A. P p}, f ` {p \<in> nodes A. Q p})) (condition A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drae_image f (dra_drae A) = drae (alphabet A) (f (initial A)) (\<Union>p\<in>nodes A. \<Union>a\<in>alphabet A. f ` {p} \<times> {a} \<times> f ` {transition A a p}) (map (\<lambda>(P, Q). (f ` {p \<in> nodes A. P p}, f ` {p \<in> nodes A. Q p})) (condition A))
[PROOF STEP]
unfolding dra_drae_def drae_image_def drae.simps Set.filter_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alphabete (drae (alphabet A) (initial A) (transitions (alphabet A) (nodes A) (transition A)) (map (\<lambda>(P, Q). ({a \<in> nodes A. P a}, {a \<in> nodes A. Q a})) (condition A))) = alphabet A \<and> f (initiale (drae (alphabet A) (initial A) (transitions (alphabet A) (nodes A) (transition A)) (map (\<lambda>(P, Q). ({a \<in> nodes A. P a}, {a \<in> nodes A. Q a})) (condition A)))) = f (initial A) \<and> (\<lambda>(p, a, q). (f p, a, f q)) ` transitione (drae (alphabet A) (initial A) (transitions (alphabet A) (nodes A) (transition A)) (map (\<lambda>(P, Q). ({a \<in> nodes A. P a}, {a \<in> nodes A. Q a})) (condition A))) = (\<Union>p\<in>nodes A. \<Union>a\<in>alphabet A. f ` {p} \<times> {a} \<times> f ` {transition A a p}) \<and> map (map_prod ((`) f) ((`) f)) (conditione (drae (alphabet A) (initial A) (transitions (alphabet A) (nodes A) (transition A)) (map (\<lambda>(P, Q). ({a \<in> nodes A. P a}, {a \<in> nodes A. Q a})) (condition A)))) = map (\<lambda>(P, Q). (f ` {p \<in> nodes A. P p}, f ` {p \<in> nodes A. Q p})) (condition A)
[PROOF STEP]
by force


[STATEMENT]
lemma conway_monoid_identity:
  assumes "conway_assm1 x" "conway_assm2 x"
  shows "(\<Sum> {x\<^bsub>i\<^esub>|i. i\<in>UNIV})\<^sup>\<star> = (\<Sum> {x\<^bsub>i\<^esub>| i. i\<in>UNIV})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}\<^sup>\<star> = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}\<^sup>\<star> = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
have one:"(\<Sum> {x\<^bsub>i\<^esub>|i. i\<in>UNIV}) \<cdot> (\<Sum> {x\<^bsub>i\<^esub>|i. i\<in>UNIV}) = (1 + (\<Sum> {x\<^bsub>i\<^esub>|i. i\<in>UNIV})) \<cdot> (1 + (\<Sum> {x\<^bsub>i\<^esub>|i. i\<in>UNIV}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = ((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}) \<cdot> ((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV})
[PROOF STEP]
by (metis (mono_tags) assms(2) conway_monoid_split)
[PROOF STATE]
proof (state)
this:
\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = ((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}) \<cdot> ((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV})

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}\<^sup>\<star> = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = ((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}) \<cdot> ((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV})

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}\<^sup>\<star> = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
have "... = 1 + (\<Sum> {x\<^bsub>i\<^esub>|i. i\<in>UNIV}) + ((\<Sum> {x\<^bsub>i\<^esub>|i. i\<in>UNIV}) \<cdot> (\<Sum> {x\<^bsub>i\<^esub>|i. i\<in>UNIV}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}) \<cdot> ((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}) = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
by (metis (lifting, no_types) calculation less_eq_def mult_isol mult_isol_equiv_subdistl mult_oner)
[PROOF STATE]
proof (state)
this:
((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}) \<cdot> ((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}) = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}\<^sup>\<star> = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}) \<cdot> ((1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}) = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}\<^sup>\<star> = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
have "... = 1 + (\<Sum> {x\<^bsub>i\<^esub>|i. i\<in>UNIV}) + (\<Sum> {x\<^bsub>i \<^esub>\<cdot> x\<^bsub>j\<^esub> | i j. i\<in>UNIV \<and> j\<in>UNIV})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}
[PROOF STEP]
by (simp only: dioid_sum_prod finite_UNIV)
[PROOF STATE]
proof (state)
this:
(1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}\<^sup>\<star> = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}
[PROOF STEP]
have "\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}"
[PROOF STATE]
proof (prove)
using this:
\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
apply (simp only:)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} \<Longrightarrow> (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} \<Longrightarrow> (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
assume a1: "\<Sum>{x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum>{x\<^bsub>i\<^esub> |i. i \<in> UNIV} = 1 + \<Sum>{x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum>{x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}"
[PROOF STATE]
proof (state)
this:
\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} \<Longrightarrow> (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
hence "\<Sum>{x\<^bsub>R\<^esub> |R. R \<in> UNIV} \<cdot> \<Sum>{x\<^bsub>R\<^esub> |R. R \<in> UNIV} = \<Sum>{x\<^bsub>R\<^esub> |R. R \<in> UNIV}"
[PROOF STATE]
proof (prove)
using this:
\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV} = \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV}
[PROOF STEP]
using assms(1) assms(2) boffa_aux3 conway_monoid_split
[PROOF STATE]
proof (prove)
using this:
\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}
conway_assm1 x
conway_assm2 x
conway_assm1 ?x \<Longrightarrow> \<Sum> {?x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {?x\<^bsub>i\<^esub> \<cdot> ?x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} = \<Sum> {?x\<^bsub>i\<^esub> |i. i \<in> UNIV}
conway_assm2 ?x \<Longrightarrow> \<Sum> {?x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::?'b) + \<Sum> {?x\<^bsub>i\<^esub> |i. i \<in> UNIV}

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV} = \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV} = \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV}

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} \<Longrightarrow> (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
thus "1 + \<Sum>{x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum>{x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} = \<Sum>{x\<^bsub>i\<^esub> |i. i \<in> UNIV}"
[PROOF STATE]
proof (prove)
using this:
\<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV} = \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV}

goal (1 subgoal):
 1. (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
\<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV} = \<Sum> {x\<^bsub>R\<^esub> |R. R \<in> UNIV}
\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}

goal (1 subgoal):
 1. (1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'b) + \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} + \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}\<^sup>\<star> = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} \<cdot> \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV} = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}

goal (1 subgoal):
 1. \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}\<^sup>\<star> = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}
[PROOF STEP]
by (metis (mono_tags) one B1_algebra_class.R star_trans_eq)
[PROOF STATE]
proof (state)
this:
\<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}\<^sup>\<star> = \<Sum> {x\<^bsub>i\<^esub> |i. i \<in> UNIV}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma maximal_repetition_sets_from_separators_code[code]:
  "maximal_repetition_sets_from_separators M = (let DR = (image fst (d_reachable_states_with_preambles M))
    in  image (\<lambda> S . (S, S \<inter> DR)) (maximal_pairwise_r_distinguishable_state_sets_from_separators M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maximal_repetition_sets_from_separators M = (let DR = fst ` d_reachable_states_with_preambles M in (\<lambda>S. (S, S \<inter> DR)) ` maximal_pairwise_r_distinguishable_state_sets_from_separators M)
[PROOF STEP]
unfolding maximal_repetition_sets_from_separators_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(S, S \<inter> fst ` d_reachable_states_with_preambles M) |S. S \<in> maximal_pairwise_r_distinguishable_state_sets_from_separators M} = (\<lambda>S. (S, S \<inter> fst ` d_reachable_states_with_preambles M)) ` maximal_pairwise_r_distinguishable_state_sets_from_separators M
[PROOF STEP]
by force