[STATEMENT]
lemma ordertype_inc_eq:
  assumes "small A"
    and \<pi>: "\<And>x y. \<lbrakk>x\<in>A; y\<in>A; (x,y) \<in> r\<rbrakk> \<Longrightarrow> (\<pi> x, \<pi> y) \<in> s"
    and r: "wf r" "total_on A r" and "wf s"
  shows "ordertype (\<pi> ` A) s = ordertype A r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype (\<pi> ` A) s = ordertype A r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordertype (\<pi> ` A) s = ordertype A r
[PROOF STEP]
have "ordermap (\<pi> ` A) s (\<pi> x) = ordermap A r x" if "x \<in> A" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordermap (\<pi> ` A) s (\<pi> x) = ordermap A r x
[PROOF STEP]
using assms that
[PROOF STATE]
proof (prove)
using this:
small A
\<lbrakk>?x \<in> A; ?y \<in> A; (?x, ?y) \<in> r\<rbrakk> \<Longrightarrow> (\<pi> ?x, \<pi> ?y) \<in> s
wf r
total_on A r
wf s
x \<in> A

goal (1 subgoal):
 1. ordermap (\<pi> ` A) s (\<pi> x) = ordermap A r x
[PROOF STEP]
by (auto simp: ordermap_inc_eq)
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Longrightarrow> ordermap (\<pi> ` A) s (\<pi> ?x) = ordermap A r ?x

goal (1 subgoal):
 1. ordertype (\<pi> ` A) s = ordertype A r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> A \<Longrightarrow> ordermap (\<pi> ` A) s (\<pi> ?x) = ordermap A r ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> ordermap (\<pi> ` A) s (\<pi> ?x) = ordermap A r ?x

goal (1 subgoal):
 1. ordertype (\<pi> ` A) s = ordertype A r
[PROOF STEP]
unfolding ordertype_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> ordermap (\<pi> ` A) s (\<pi> ?x) = ordermap A r ?x

goal (1 subgoal):
 1. set (ordermap (\<pi> ` A) s ` \<pi> ` A) = set (ordermap A r ` A)
[PROOF STEP]
by (metis (no_types, lifting) image_cong image_image)
[PROOF STATE]
proof (state)
this:
ordertype (\<pi> ` A) s = ordertype A r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_frequently_conj: "frequently P F \<Longrightarrow> eventually Q F \<Longrightarrow> frequently (\<lambda>x. P x \<and> Q x) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>frequently P F; eventually Q F\<rbrakk> \<Longrightarrow> \<exists>\<^sub>F x in F. P x \<and> Q x
[PROOF STEP]
unfolding frequently_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> (\<forall>\<^sub>F x in F. \<not> P x); eventually Q F\<rbrakk> \<Longrightarrow> \<not> (\<forall>\<^sub>F x in F. \<not> (P x \<and> Q x))
[PROOF STEP]
apply (erule contrapos_nn)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>eventually Q F; \<forall>\<^sub>F x in F. \<not> (P x \<and> Q x)\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. \<not> P x
[PROOF STEP]
subgoal premises prems
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<not> P x
[PROOF STEP]
using prems
[PROOF STATE]
proof (prove)
using this:
eventually Q F
\<forall>\<^sub>F x in F. \<not> (P x \<and> Q x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<not> P x
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma DirProds_is_group:
  assumes "\<And>i. i \<in> I \<Longrightarrow> group (G i)"
  shows "group (DirProds G I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (DirProds G I)
[PROOF STEP]
proof(rule groupI)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<one>\<^bsub>DirProds G I\<^esub> \<in> carrier (DirProds G I)
 3. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
 4. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> \<otimes>\<^bsub>DirProds G I\<^esub> x = x
 5. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
show one_closed: "\<one>\<^bsub>DirProds G I\<^esub> \<in> carrier (DirProds G I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>DirProds G I\<^esub> \<in> carrier (DirProds G I)
[PROOF STEP]
unfolding DirProds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> \<in> carrier \<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>
[PROOF STEP]
by (simp add: assms group.is_monoid)
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>DirProds G I\<^esub> \<in> carrier (DirProds G I)

goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
 3. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> \<otimes>\<^bsub>DirProds G I\<^esub> x = x
 4. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
 3. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> \<otimes>\<^bsub>DirProds G I\<^esub> x = x
 4. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
assume x: "x \<in> carrier (DirProds G I)"
[PROOF STATE]
proof (state)
this:
x \<in> carrier (DirProds G I)

goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
 3. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> \<otimes>\<^bsub>DirProds G I\<^esub> x = x
 4. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
have one_: "\<And>i. i \<in> I \<Longrightarrow> \<one>\<^bsub>G i\<^esub> = \<one>\<^bsub>DirProds G I\<^esub> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> \<one>\<^bsub>G i\<^esub> = \<one>\<^bsub>DirProds G I\<^esub> i
[PROOF STEP]
unfolding DirProds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> \<one>\<^bsub>G i\<^esub> = \<one>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> \<one>\<^bsub>G ?i\<^esub> = \<one>\<^bsub>DirProds G I\<^esub> ?i

goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
 3. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> \<otimes>\<^bsub>DirProds G I\<^esub> x = x
 4. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
have "\<And>i. i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> i \<otimes>\<^bsub>G i\<^esub> x i = x i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> i \<otimes>\<^bsub>G i\<^esub> x i = x i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> i \<otimes>\<^bsub>G i\<^esub> x i = x i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> i \<otimes>\<^bsub>G i\<^esub> x i = x i
[PROOF STEP]
assume i: "i \<in> I"
[PROOF STATE]
proof (state)
this:
i \<in> I

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> i \<otimes>\<^bsub>G i\<^esub> x i = x i
[PROOF STEP]
interpret group "G i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (G i)
[PROOF STEP]
using assms[OF i]
[PROOF STATE]
proof (prove)
using this:
Group.group (G i)

goal (1 subgoal):
 1. Group.group (G i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> i \<otimes>\<^bsub>G i\<^esub> x i = x i
[PROOF STEP]
have "x i \<in> carrier (G i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x i \<in> carrier (G i)
[PROOF STEP]
using x i comp_in_carr
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (DirProds G I)
i \<in> I
\<lbrakk>?x \<in> carrier (DirProds ?G ?I); ?i \<in> ?I\<rbrakk> \<Longrightarrow> ?x ?i \<in> carrier (?G ?i)

goal (1 subgoal):
 1. x i \<in> carrier (G i)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
x i \<in> carrier (G i)

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> i \<otimes>\<^bsub>G i\<^esub> x i = x i
[PROOF STEP]
thus "\<one>\<^bsub>DirProds G I\<^esub> i \<otimes>\<^bsub>G i\<^esub> x i = x i"
[PROOF STATE]
proof (prove)
using this:
x i \<in> carrier (G i)

goal (1 subgoal):
 1. \<one>\<^bsub>DirProds G I\<^esub> i \<otimes>\<^bsub>G i\<^esub> x i = x i
[PROOF STEP]
by(subst one_[OF i, symmetric]; simp)
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>DirProds G I\<^esub> i \<otimes>\<^bsub>G i\<^esub> x i = x i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> ?i \<otimes>\<^bsub>G ?i\<^esub> x ?i = x ?i

goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
 3. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> \<otimes>\<^bsub>DirProds G I\<^esub> x = x
 4. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
with one_ x
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> \<one>\<^bsub>G ?i\<^esub> = \<one>\<^bsub>DirProds G I\<^esub> ?i
x \<in> carrier (DirProds G I)
?i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> ?i \<otimes>\<^bsub>G ?i\<^esub> x ?i = x ?i
[PROOF STEP]
show "\<one>\<^bsub>DirProds G I\<^esub> \<otimes>\<^bsub>DirProds G I\<^esub> x = x"
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> \<one>\<^bsub>G ?i\<^esub> = \<one>\<^bsub>DirProds G I\<^esub> ?i
x \<in> carrier (DirProds G I)
?i \<in> I \<Longrightarrow> \<one>\<^bsub>DirProds G I\<^esub> ?i \<otimes>\<^bsub>G ?i\<^esub> x ?i = x ?i

goal (1 subgoal):
 1. \<one>\<^bsub>DirProds G I\<^esub> \<otimes>\<^bsub>DirProds G I\<^esub> x = x
[PROOF STEP]
unfolding DirProds_def
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> \<one>\<^bsub>G ?i\<^esub> = \<one>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> ?i
x \<in> carrier \<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>
?i \<in> I \<Longrightarrow> \<one>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> ?i \<otimes>\<^bsub>G ?i\<^esub> x ?i = x ?i

goal (1 subgoal):
 1. \<one>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> \<otimes>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> x = x
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>DirProds G I\<^esub> \<otimes>\<^bsub>DirProds G I\<^esub> x = x

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
 3. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
have "restrict (\<lambda>i. inv\<^bsub>G i\<^esub> (x i)) I \<in> carrier (DirProds G I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (DirProds G I)
[PROOF STEP]
using x group.inv_closed[OF assms]
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (DirProds G I)
\<lbrakk>?i1 \<in> I; ?x \<in> carrier (G ?i1)\<rbrakk> \<Longrightarrow> inv\<^bsub>G ?i1\<^esub> ?x \<in> carrier (G ?i1)

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (DirProds G I)
[PROOF STEP]
unfolding DirProds_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier \<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>
\<lbrakk>?i1 \<in> I; ?x \<in> carrier (G ?i1)\<rbrakk> \<Longrightarrow> inv\<^bsub>G ?i1\<^esub> ?x \<in> carrier (G ?i1)

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier \<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (DirProds G I)

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
 3. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (DirProds G I)

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
 3. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
have "restrict (\<lambda>i. inv\<^bsub>G i\<^esub> (x i)) I \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
using x group.l_inv[OF assms]
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (DirProds G I)
\<lbrakk>?i1 \<in> I; ?x \<in> carrier (G ?i1)\<rbrakk> \<Longrightarrow> inv\<^bsub>G ?i1\<^esub> ?x \<otimes>\<^bsub>G ?i1\<^esub> ?x = \<one>\<^bsub>G ?i1\<^esub>

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
unfolding DirProds_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier \<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>
\<lbrakk>?i1 \<in> I; ?x \<in> carrier (G ?i1)\<rbrakk> \<Longrightarrow> inv\<^bsub>G ?i1\<^esub> ?x \<otimes>\<^bsub>G ?i1\<^esub> ?x = \<one>\<^bsub>G ?i1\<^esub>

goal (1 subgoal):
 1. (\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<otimes>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> x = \<one>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
 3. \<And>x. x \<in> carrier (DirProds G I) \<Longrightarrow> \<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (DirProds G I)
(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
show "\<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<in> carrier (DirProds G I)
(\<lambda>i\<in>I. inv\<^bsub>G i\<^esub> x i) \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>

goal (1 subgoal):
 1. \<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>carrier (DirProds G I). y \<otimes>\<^bsub>DirProds G I\<^esub> x = \<one>\<^bsub>DirProds G I\<^esub>

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
[PROOF STEP]
assume y: "y \<in> carrier (DirProds G I)"
[PROOF STATE]
proof (state)
this:
y \<in> carrier (DirProds G I)

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
[PROOF STEP]
from DirProds_m_closed[OF x y assms]
[PROOF STATE]
proof (chain)
picking this:
(\<And>i. i \<in> I \<Longrightarrow> i \<in> I) \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
[PROOF STEP]
show m_closed: "x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)"
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i \<in> I \<Longrightarrow> i \<in> I) \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)

goal (1 subgoal):
 1. x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<otimes>\<^bsub>DirProds G I\<^esub> y \<in> carrier (DirProds G I)

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
[PROOF STEP]
assume z: "z \<in> carrier (DirProds G I)"
[PROOF STATE]
proof (state)
this:
z \<in> carrier (DirProds G I)

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
[PROOF STEP]
have "\<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i
                    = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
assume i: "i \<in> I"
[PROOF STATE]
proof (state)
this:
i \<in> I

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
have "(x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> y) i \<otimes>\<^bsub>G i\<^esub> z i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> y) i \<otimes>\<^bsub>G i\<^esub> z i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> Group.group (G ?i)

goal (1 subgoal):
 1. (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> y) i \<otimes>\<^bsub>G i\<^esub> z i
[PROOF STEP]
by (simp add: comp_mult i m_closed z)
[PROOF STATE]
proof (state)
this:
(x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> y) i \<otimes>\<^bsub>G i\<^esub> z i

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> y) i \<otimes>\<^bsub>G i\<^esub> z i

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
have "\<dots> = x i \<otimes>\<^bsub>G i\<^esub> y i \<otimes>\<^bsub>G i\<^esub> z i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<otimes>\<^bsub>DirProds G I\<^esub> y) i \<otimes>\<^bsub>G i\<^esub> z i = x i \<otimes>\<^bsub>G i\<^esub> y i \<otimes>\<^bsub>G i\<^esub> z i
[PROOF STEP]
by (simp add: assms comp_mult i x y)
[PROOF STATE]
proof (state)
this:
(x \<otimes>\<^bsub>DirProds G I\<^esub> y) i \<otimes>\<^bsub>G i\<^esub> z i = x i \<otimes>\<^bsub>G i\<^esub> y i \<otimes>\<^bsub>G i\<^esub> z i

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<otimes>\<^bsub>DirProds G I\<^esub> y) i \<otimes>\<^bsub>G i\<^esub> z i = x i \<otimes>\<^bsub>G i\<^esub> y i \<otimes>\<^bsub>G i\<^esub> z i

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
have "\<dots> = x i \<otimes>\<^bsub>G i\<^esub> (y i \<otimes>\<^bsub>G i\<^esub> z i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x i \<otimes>\<^bsub>G i\<^esub> y i \<otimes>\<^bsub>G i\<^esub> z i = x i \<otimes>\<^bsub>G i\<^esub> (y i \<otimes>\<^bsub>G i\<^esub> z i)
[PROOF STEP]
using i assms x y z
[PROOF STATE]
proof (prove)
using this:
i \<in> I
?i \<in> I \<Longrightarrow> Group.group (G ?i)
x \<in> carrier (DirProds G I)
y \<in> carrier (DirProds G I)
z \<in> carrier (DirProds G I)

goal (1 subgoal):
 1. x i \<otimes>\<^bsub>G i\<^esub> y i \<otimes>\<^bsub>G i\<^esub> z i = x i \<otimes>\<^bsub>G i\<^esub> (y i \<otimes>\<^bsub>G i\<^esub> z i)
[PROOF STEP]
by (meson Group.group_def comp_in_carr monoid.m_assoc)
[PROOF STATE]
proof (state)
this:
x i \<otimes>\<^bsub>G i\<^esub> y i \<otimes>\<^bsub>G i\<^esub> z i = x i \<otimes>\<^bsub>G i\<^esub> (y i \<otimes>\<^bsub>G i\<^esub> z i)

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x i \<otimes>\<^bsub>G i\<^esub> y i \<otimes>\<^bsub>G i\<^esub> z i = x i \<otimes>\<^bsub>G i\<^esub> (y i \<otimes>\<^bsub>G i\<^esub> z i)

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
have "\<dots> = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x i \<otimes>\<^bsub>G i\<^esub> (y i \<otimes>\<^bsub>G i\<^esub> z i) = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
by (simp add: DirProds_def i)
[PROOF STATE]
proof (state)
this:
x i \<otimes>\<^bsub>G i\<^esub> (y i \<otimes>\<^bsub>G i\<^esub> z i) = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
show "(x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i
                = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i"
[PROOF STATE]
proof (prove)
using this:
(x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i

goal (1 subgoal):
 1. (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) ?i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) ?i

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (DirProds G I); y \<in> carrier (DirProds G I); z \<in> carrier (DirProds G I)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
[PROOF STEP]
thus "x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)"
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z) ?i = (x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)) ?i

goal (1 subgoal):
 1. x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)
[PROOF STEP]
unfolding DirProds_def
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> (x \<otimes>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> y \<otimes>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> z) ?i = (x \<otimes>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> (y \<otimes>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> z)) ?i

goal (1 subgoal):
 1. x \<otimes>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> y \<otimes>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> z = x \<otimes>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> (y \<otimes>\<^bsub>\<lparr>carrier = Pi\<^sub>E I (carrier \<circ> G), monoid.mult = \<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i, one = \<lambda>i\<in>I. \<one>\<^bsub>G i\<^esub>\<rparr>\<^esub> z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<otimes>\<^bsub>DirProds G I\<^esub> y \<otimes>\<^bsub>DirProds G I\<^esub> z = x \<otimes>\<^bsub>DirProds G I\<^esub> (y \<otimes>\<^bsub>DirProds G I\<^esub> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma absolutely_integrable_on_subcbox:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  shows "\<lbrakk>f absolutely_integrable_on S; cbox a b \<subseteq> S\<rbrakk> \<Longrightarrow> f absolutely_integrable_on cbox a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f absolutely_integrable_on S; cbox a b \<subseteq> S\<rbrakk> \<Longrightarrow> f absolutely_integrable_on cbox a b
[PROOF STEP]
by (meson absolutely_integrable_on_def integrable_on_subcbox)


[STATEMENT]
lemma (in gcd_condition_monoid) gcd_cong_l:
  assumes "x \<sim> x'" "x \<in> carrier G"  "x' \<in> carrier G"  "y \<in> carrier G"
  shows "somegcd G x y \<sim> somegcd G x' y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. somegcd G x y \<sim> somegcd G x' y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. somegcd G x y \<sim> somegcd G x' y
[PROOF STEP]
interpret weak_lower_semilattice "division_rel G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_lower_semilattice (division_rel G)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. somegcd G x y \<sim> somegcd G x' y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. somegcd G x y \<sim> somegcd G x' y
[PROOF STEP]
using somegcd_meet assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> carrier ?G; ?b \<in> carrier ?G\<rbrakk> \<Longrightarrow> somegcd ?G ?a ?b = ?a \<sqinter>\<^bsub>division_rel ?G\<^esub> ?b
x \<sim> x'
x \<in> carrier G
x' \<in> carrier G
y \<in> carrier G

goal (1 subgoal):
 1. somegcd G x y \<sim> somegcd G x' y
[PROOF STEP]
by (metis eq_object.select_convs(1) meet_cong_l partial_object.select_convs(1))
[PROOF STATE]
proof (state)
this:
somegcd G x y \<sim> somegcd G x' y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma skewlink_mset[simp]: "tree_to_multiset (skewlink e a t1 t2)
  = {# (e,a) #} +  tree_to_multiset t1 + tree_to_multiset t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tree_to_multiset (skewlink e a t1 t2) = {#(e, a)#} + tree_to_multiset t1 + tree_to_multiset t2
[PROOF STEP]
by (cases t1, cases t2, auto simp add:union_ac)


[STATEMENT]
lemma scalar_matrix_mult_code [code abstract]: "vec_nth (c *k A)  = scalar_matrix_mult_row c A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (c *k A) = scalar_matrix_mult_row c A
[PROOF STEP]
unfolding matrix_scalar_mult_def scalar_matrix_mult_row_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (\<chi>i j. c * A $ i $ j) = (\<lambda>i. \<chi>j. c * A $ i $ j)
[PROOF STEP]
using vec_lambda_beta
[PROOF STATE]
proof (prove)
using this:
vec_lambda ?g $ ?i = ?g ?i

goal (1 subgoal):
 1. ($) (\<chi>i j. c * A $ i $ j) = (\<lambda>i. \<chi>j. c * A $ i $ j)
[PROOF STEP]
by auto


[STATEMENT]
lemma pmf_of_list_wfI:
  "(\<And>x. x \<in> set (map snd xs) \<Longrightarrow> x \<ge> 0) \<Longrightarrow> sum_list (map snd xs) = 1 \<Longrightarrow> pmf_of_list_wf xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> set (map snd xs) \<Longrightarrow> (0::'a) \<le> x; sum_list (map snd xs) = (1::'a)\<rbrakk> \<Longrightarrow> pmf_of_list_wf xs
[PROOF STEP]
unfolding pmf_of_list_wf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> set (map snd xs) \<Longrightarrow> (0::'a) \<le> x; sum_list (map snd xs) = (1::'a)\<rbrakk> \<Longrightarrow> Ball (set (map snd xs)) ((\<le>) (0::'a)) \<and> sum_list (map snd xs) = (1::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma currentD_OUT':
  assumes f: "current \<Gamma> f"
  and x: "x \<notin> A \<Gamma>"
  shows "d_OUT f x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT f x = 0
[PROOF STEP]
using currentD_outside_OUT[OF f, of x] x currentD_OUT[OF f, of x] bipartite_V
[PROOF STATE]
proof (prove)
using this:
x \<notin> \<^bold>V \<Longrightarrow> d_OUT f x = 0
x \<notin> A \<Gamma>
x \<in> B \<Gamma> \<Longrightarrow> d_OUT f x = 0
\<^bold>V \<subseteq> A \<Gamma> \<union> B \<Gamma>

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


[STATEMENT]
lemma inverse_less_imp_less_neg:
  "inverse a < inverse b \<Longrightarrow> b < 0 \<Longrightarrow> b < a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inverse a < inverse b; b < (0::'a)\<rbrakk> \<Longrightarrow> b < a
[PROOF STEP]
using local.dual_order.strict_iff_order local.inverse_le_imp_le_neg
[PROOF STATE]
proof (prove)
using this:
(?b < ?a) = (?b \<le> ?a \<and> ?a \<noteq> ?b)
\<lbrakk>inverse ?a \<le> inverse ?b; ?b < (0::'a)\<rbrakk> \<Longrightarrow> ?b \<le> ?a

goal (1 subgoal):
 1. \<lbrakk>inverse a < inverse b; b < (0::'a)\<rbrakk> \<Longrightarrow> b < a
[PROOF STEP]
by blast


[STATEMENT]
lemma bibd_exists:
  assumes "dim_col M \<ge> 1" \<comment> \<open>Min one block\<close>
  assumes "\<And> j. j < dim_col M \<Longrightarrow> 1 \<in>$ col M j" \<comment> \<open>no empty blocks \<close>
  assumes "M * (M\<^sup>T) = \<Lambda> \<cdot>\<^sub>m (J\<^sub>m (dim_row M)) + (r - \<Lambda>) \<cdot>\<^sub>m (1\<^sub>m (dim_row M))"
  assumes "((u\<^sub>v (dim_row M)) \<^sub>v* M) = k \<cdot>\<^sub>v (u\<^sub>v (dim_col M))"
  assumes "(r ::nat) \<ge> 0"
  assumes "k \<ge> 2" "k < dim_row M"
  shows "ordered_bibd [0..<dim_row M] (map map_col_to_block (cols M)) k \<Lambda>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_bibd [0..<dim_row M] (map map_col_to_block (cols M)) k \<Lambda>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordered_bibd [0..<dim_row M] (map map_col_to_block (cols M)) k \<Lambda>
[PROOF STEP]
interpret ipbd: ordered_regular_pairwise_balance "[0..<dim_row M]" "(map map_col_to_block (cols M))" \<Lambda> r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_regular_pairwise_balance [0..<dim_row M] (map map_col_to_block (cols M)) \<Lambda> r
[PROOF STEP]
using rpbd_exists assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 \<le> dim_row M; 1 \<le> dim_col M; \<And>j. j < dim_col M \<Longrightarrow> 1 \<in>$ col M j; M * M\<^sup>T = int ?\<Lambda> \<cdot>\<^sub>m J\<^sub>m (dim_row M) + (int ?r - int ?\<Lambda>) \<cdot>\<^sub>m 1\<^sub>m (dim_row M)\<rbrakk> \<Longrightarrow> ordered_regular_pairwise_balance [0..<dim_row M] (map map_col_to_block (cols M)) ?\<Lambda> ?r
1 \<le> dim_col M
?j < dim_col M \<Longrightarrow> 1 \<in>$ col M ?j
M * M\<^sup>T = int \<Lambda> \<cdot>\<^sub>m J\<^sub>m (dim_row M) + (int r - int \<Lambda>) \<cdot>\<^sub>m 1\<^sub>m (dim_row M)
u\<^sub>v (dim_row M) \<^sub>v* M = int k \<cdot>\<^sub>v u\<^sub>v (dim_col M)
0 \<le> r
2 \<le> k
k < dim_row M

goal (1 subgoal):
 1. ordered_regular_pairwise_balance [0..<dim_row M] (map map_col_to_block (cols M)) \<Lambda> r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordered_bibd [0..<dim_row M] (map ipbd.map_col_to_block (cols M)) k \<Lambda>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_bibd [0..<dim_row M] (map ipbd.map_col_to_block (cols M)) k \<Lambda>
[PROOF STEP]
using vec_k_impl_uniform_block_size
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>u\<^sub>v (dim_row M) \<^sub>v* M = int ?k \<cdot>\<^sub>v u\<^sub>v (dim_col M); ?bl \<in># image_mset ipbd.map_col_to_block (mset (cols M))\<rbrakk> \<Longrightarrow> card ?bl = ?k

goal (1 subgoal):
 1. ordered_bibd [0..<dim_row M] (map ipbd.map_col_to_block (cols M)) k \<Lambda>
[PROOF STEP]
by (unfold_locales, simp_all add: assms)
[PROOF STATE]
proof (state)
this:
ordered_bibd [0..<dim_row M] (map ipbd.map_col_to_block (cols M)) k \<Lambda>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma BseqD: "Bseq X \<Longrightarrow> \<exists>K. 0 < K \<and> (\<forall>n. norm (X n) \<le> K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bseq X \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
by (simp add: Bseq_def)


[STATEMENT]
lemma lexer_correct_None:
  shows "s \<notin> lang r \<longleftrightarrow> lexer r s = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s \<notin> lang r) = (lexer r s = None)
[PROOF STEP]
apply(induct s arbitrary: r)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>r. ([] \<notin> lang r) = (lexer r [] = None)
 2. \<And>a s r. (\<And>r. (s \<notin> lang r) = (lexer r s = None)) \<Longrightarrow> (a # s \<notin> lang r) = (lexer r (a # s) = None)
[PROOF STEP]
apply(simp add: nullable_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a s r. (\<And>r. (s \<notin> lang r) = (lexer r s = None)) \<Longrightarrow> (a # s \<notin> lang r) = (lexer r (a # s) = None)
[PROOF STEP]
apply(drule_tac x="deriv a r" in meta_spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a s r. (s \<notin> lang (deriv a r)) = (lexer (deriv a r) s = None) \<Longrightarrow> (a # s \<notin> lang r) = (lexer r (a # s) = None)
[PROOF STEP]
apply(auto simp add: lang_deriv Deriv_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rank_invar_to_set: "rank_invar (t # bq) \<Longrightarrow>
  \<forall> t' \<in> set bq. rank t < rank t'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank_invar (t # bq) \<Longrightarrow> \<forall>t'\<in>set bq. rank t < rank t'
[PROOF STEP]
apply(induct bq arbitrary: t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>t. rank_invar [t] \<Longrightarrow> \<forall>t'\<in>set []. rank t < rank t'
 2. \<And>a bq t. \<lbrakk>\<And>t. rank_invar (t # bq) \<Longrightarrow> \<forall>t'\<in>set bq. rank t < rank t'; rank_invar (t # a # bq)\<rbrakk> \<Longrightarrow> \<forall>t'\<in>set (a # bq). rank t < rank t'
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a bq t. \<lbrakk>\<And>t. rank_invar (t # bq) \<Longrightarrow> \<forall>t'\<in>set bq. rank t < rank t'; rank_invar (t # a # bq)\<rbrakk> \<Longrightarrow> \<forall>t'\<in>set (a # bq). rank t < rank t'
[PROOF STEP]
apply (metis nat_less_le rank_invar.simps(3) set_ConsD xt1(7))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done