[STATEMENT]
lemma op_dg_dg_prod_2[dg_op_simps]: "op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>) = op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>) = op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>
[PROOF STEP]
proof(rule vsv_eqI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. vsv (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>))
 2. vsv (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)
 3. \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) = \<D>\<^sub>\<circ> (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)
 4. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) \<Longrightarrow> op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>a\<rparr>
[PROOF STEP]
show "vsv (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>))
[PROOF STEP]
unfolding op_dg_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv [(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>, (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>, (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>, (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>]\<^sub>\<circ>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vsv (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>))

goal (3 subgoals):
 1. vsv (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)
 2. \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) = \<D>\<^sub>\<circ> (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)
 3. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) \<Longrightarrow> op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>a\<rparr>
[PROOF STEP]
show "vsv (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)
[PROOF STEP]
unfolding dg_prod_2_def dg_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv [\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> op_dg \<AA> | otherwise \<Rightarrow> op_dg \<BB>)\<lparr>Obj\<rparr>, \<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> op_dg \<AA> | otherwise \<Rightarrow> op_dg \<BB>)\<lparr>Arr\<rparr>, \<lambda>f\<in>\<^sub>\<circ>\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> op_dg \<AA> | otherwise \<Rightarrow> op_dg \<BB>)\<lparr>Arr\<rparr>. \<lambda>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> op_dg \<AA> | otherwise \<Rightarrow> op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>f\<lparr>i\<rparr>\<rparr>, \<lambda>f\<in>\<^sub>\<circ>\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> op_dg \<AA> | otherwise \<Rightarrow> op_dg \<BB>)\<lparr>Arr\<rparr>. \<lambda>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> op_dg \<AA> | otherwise \<Rightarrow> op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>f\<lparr>i\<rparr>\<rparr>]\<^sub>\<circ>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vsv (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)

goal (2 subgoals):
 1. \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) = \<D>\<^sub>\<circ> (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)
 2. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) \<Longrightarrow> op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>a\<rparr>
[PROOF STEP]
have dom_lhs: "\<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) = 4\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) = 4\<^sub>\<nat>
[PROOF STEP]
by (simp add: op_dg_def nat_omega_simps)
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) = 4\<^sub>\<nat>

goal (2 subgoals):
 1. \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) = \<D>\<^sub>\<circ> (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)
 2. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) \<Longrightarrow> op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>a\<rparr>
[PROOF STEP]
show "\<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) = \<D>\<^sub>\<circ> (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) = \<D>\<^sub>\<circ> (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)
[PROOF STEP]
unfolding dom_lhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4\<^sub>\<nat> = \<D>\<^sub>\<circ> (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)
[PROOF STEP]
by (simp add: dg_prod_2_def dg_prod_def nat_omega_simps)
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) = \<D>\<^sub>\<circ> (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)

goal (1 subgoal):
 1. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) \<Longrightarrow> op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>a\<rparr>
[PROOF STEP]
have Cod_Dom: "(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>
[PROOF STEP]
proof(rule vsv_eqI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>)
 2. vsv ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)
 3. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)
 4. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
from \<AA> \<BB>
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
[PROOF STEP]
show "vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>)"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>

goal (1 subgoal):
 1. vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>)
[PROOF STEP]
by (rule dg_prod_2_Cod_vsv)
[PROOF STATE]
proof (state)
this:
vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>)

goal (3 subgoals):
 1. vsv ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)
 2. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)
 3. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
from \<AA> \<BB>
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
[PROOF STEP]
show "vsv ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>

goal (1 subgoal):
 1. vsv ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)
[PROOF STEP]
by (cs_concl cs_shallow cs_intro: dg_prod_2_Dom_vsv dg_op_intros)+
[PROOF STATE]
proof (state)
this:
vsv ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)

goal (2 subgoals):
 1. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)
 2. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
from \<AA> \<BB>
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
[PROOF STEP]
have dom_lhs: "\<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) = (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) = (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>
[PROOF STEP]
by (cs_concl cs_shallow cs_simp: dg_cs_simps)
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) = (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>

goal (2 subgoals):
 1. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)
 2. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
from \<AA> \<BB>
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
[PROOF STEP]
show "\<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)
[PROOF STEP]
unfolding dom_lhs
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)
[PROOF STEP]
by
        (
          cs_concl cs_shallow
            cs_simp: dg_cs_simps dg_op_simps cs_intro: dg_op_intros
        )
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>)

goal (1 subgoal):
 1. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
show "(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr>"
      if "gf \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>)" for gf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
gf \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>)

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
unfolding dom_lhs
[PROOF STATE]
proof (prove)
using this:
gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
assume "gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (state)
this:
gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>
[PROOF STEP]
obtain g f
        where gf_def: "gf = [g, f]\<^sub>\<circ>"
          and g: "g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>"
          and f: "f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
using this:
gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<And>g f. \<lbrakk>gf = [g, f]\<^sub>\<circ>; g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>; f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule dg_prod_2_ArrE[OF \<AA> \<BB>]) simp
[PROOF STATE]
proof (state)
this:
gf = [g, f]\<^sub>\<circ>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
from \<AA> \<BB> g f
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>
[PROOF STEP]
show "(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr>"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
unfolding gf_def
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr> \<lparr>g, f\<rparr>\<^sub>\<bullet> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr> \<lparr>g, f\<rparr>\<^sub>\<bullet>
[PROOF STEP]
by
          (
            cs_concl cs_shallow
              cs_simp: dg_prod_cs_simps dg_op_simps
              cs_intro: dg_prod_cs_intros dg_op_intros
          )
[PROOF STATE]
proof (state)
this:
(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?gf \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>) \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr>\<lparr>?gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>\<lparr>?gf\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>

goal (1 subgoal):
 1. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) \<Longrightarrow> op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>a\<rparr>
[PROOF STEP]
have Dom_Cod: "(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>
[PROOF STEP]
proof(rule vsv_eqI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>)
 2. vsv ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>)
 3. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>)
 4. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
from \<AA> \<BB>
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
[PROOF STEP]
show "vsv ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>)"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>

goal (1 subgoal):
 1. vsv ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>)
[PROOF STEP]
by (cs_concl cs_shallow cs_intro: dg_prod_2_Cod_vsv dg_op_intros)+
[PROOF STATE]
proof (state)
this:
vsv ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>)

goal (3 subgoals):
 1. vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>)
 2. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>)
 3. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
from \<AA> \<BB>
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
[PROOF STEP]
have dom_lhs: "\<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) = (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) = (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>
[PROOF STEP]
by (cs_concl cs_shallow cs_simp: dg_cs_simps)
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) = (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>

goal (3 subgoals):
 1. vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>)
 2. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>)
 3. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
from \<AA> \<BB>
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
[PROOF STEP]
show "\<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>)"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>)
[PROOF STEP]
unfolding dom_lhs
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>)
[PROOF STEP]
by
        (
          cs_concl cs_shallow
            cs_simp: dg_cs_simps dg_op_simps cs_intro: dg_op_intros
        )
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) = \<D>\<^sub>\<circ> ((op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>)

goal (2 subgoals):
 1. vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>)
 2. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
show "(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr>"
      if "gf \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>)" for gf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
gf \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>)

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
unfolding dom_lhs
[PROOF STATE]
proof (prove)
using this:
gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
assume "gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (state)
this:
gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>
[PROOF STEP]
obtain g f
        where gf_def: "gf = [g, f]\<^sub>\<circ>"
          and g: "g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>"
          and f: "f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
using this:
gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<And>g f. \<lbrakk>gf = [g, f]\<^sub>\<circ>; g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>; f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule dg_prod_2_ArrE[OF \<AA> \<BB>]) simp
[PROOF STATE]
proof (state)
this:
gf = [g, f]\<^sub>\<circ>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. gf \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
from \<AA> \<BB> g f
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>
[PROOF STEP]
show "(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr>"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr>
[PROOF STEP]
unfolding gf_def
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr> \<lparr>g, f\<rparr>\<^sub>\<bullet> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr> \<lparr>g, f\<rparr>\<^sub>\<bullet>
[PROOF STEP]
by
          (
            cs_concl cs_shallow
              cs_simp: dg_cs_simps dg_prod_cs_simps dg_op_simps
              cs_intro: dg_op_intros dg_prod_cs_intros
          )
[PROOF STATE]
proof (state)
this:
(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>gf\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?gf \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>\<lparr>?gf\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>\<lparr>?gf\<rparr>

goal (1 subgoal):
 1. vsv ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>)
[PROOF STEP]
qed (auto intro: \<AA> \<BB> dg_prod_2_Dom_vsv)
[PROOF STATE]
proof (state)
this:
(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>

goal (1 subgoal):
 1. \<And>a. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) \<Longrightarrow> op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>a\<rparr>
[PROOF STEP]
show "a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) \<Longrightarrow>
    op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>a\<rparr>"
    for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) \<Longrightarrow> op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>a\<rparr>
[PROOF STEP]
proof
    (
      unfold dom_lhs,
      elim_in_numeral,
      fold dg_field_simps,
      unfold op_dg_components
    )
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Obj\<rparr>
 2. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Arr\<rparr>
 3. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>
 4. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>
[PROOF STEP]
from \<AA> \<BB>
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
[PROOF STEP]
show "(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
by (cs_concl cs_shallow cs_simp: dg_op_simps cs_intro: dg_op_intros)
[PROOF STATE]
proof (state)
this:
(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Obj\<rparr>

goal (3 subgoals):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Arr\<rparr>
 2. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>
 3. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>
[PROOF STEP]
from \<AA> \<BB>
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
[PROOF STEP]
show "(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Arr\<rparr>
[PROOF STEP]
by (cs_concl cs_shallow cs_simp: dg_op_simps cs_intro: dg_op_intros)
[PROOF STATE]
proof (state)
this:
(\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Arr\<rparr>

goal (2 subgoals):
 1. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Cod\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Dom\<rparr>
 2. (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>Cod\<rparr>
[PROOF STEP]
qed (auto simp: \<AA> \<BB> Cod_Dom Dom_Cod)
[PROOF STATE]
proof (state)
this:
?a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> (op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)) \<Longrightarrow> op_dg (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>?a\<rparr> = (op_dg \<AA> \<times>\<^sub>D\<^sub>G op_dg \<BB>)\<lparr>?a\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma permute_multiset [simp]:
  fixes M N::"('a::pt) multiset"
  shows "(p \<bullet> {#}) = ({#} ::('a::pt) multiset)"
  and   "(p \<bullet> add_mset x M) = add_mset (p \<bullet> x) (p \<bullet> M)"
  and   "(p \<bullet> (M + N)) = (p \<bullet> M) + (p \<bullet> N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<bullet> {#} = {#} &&& p \<bullet> add_mset x M = add_mset (p \<bullet> x) (p \<bullet> M) &&& p \<bullet> (M + N) = p \<bullet> M + p \<bullet> N
[PROOF STEP]
unfolding permute_multiset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset (permute p) {#} = {#} &&& image_mset (permute p) (add_mset x M) = add_mset (p \<bullet> x) (image_mset (permute p) M) &&& image_mset (permute p) (M + N) = image_mset (permute p) M + image_mset (permute p) N
[PROOF STEP]
by (simp_all)


[STATEMENT]
lemma funcset_comp:
  "\<lbrakk> f : A \<rightarrow> B; g : B \<rightarrow> C \<rbrakk> \<Longrightarrow> g \<circ> f : A \<rightarrow> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; g \<in> B \<rightarrow> C\<rbrakk> \<Longrightarrow> g \<circ> f \<in> A \<rightarrow> C
[PROOF STEP]
by (auto intro!: funcsetI dest!: funcset_mem)


[STATEMENT]
lemma icard_eq_enat_card_conv: "0 < n \<Longrightarrow> (icard A = enat n) = (card A = n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (icard A = enat n) = (card A = n)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < n; icard A = enat n\<rbrakk> \<Longrightarrow> card A = n
 2. \<lbrakk>0 < n; card A = n\<rbrakk> \<Longrightarrow> icard A = enat n
[PROOF STEP]
apply (simp add: icard_eq_enat_imp_card)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; card A = n\<rbrakk> \<Longrightarrow> icard A = enat n
[PROOF STEP]
apply (drule sym, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < card A; n = card A\<rbrakk> \<Longrightarrow> icard A = enat (card A)
[PROOF STEP]
apply (frule card_gr0_imp_finite)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < card A; n = card A; finite A\<rbrakk> \<Longrightarrow> icard A = enat (card A)
[PROOF STEP]
apply (rule icard_finite, assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma invimage_vcomp: "(r \<circ>\<^sub>\<circ> s) -`\<^sub>\<circ> x = s -`\<^sub>\<circ> (r -`\<^sub>\<circ> x) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r \<circ>\<^sub>\<circ> s) -`\<^sub>\<circ> x = s -`\<^sub>\<circ> r -`\<^sub>\<circ> x
[PROOF STEP]
by (simp add: invimage_def vconverse_vcomp vcomp_vimage)


[STATEMENT]
lemma singular_chain_imp_relboundary:
   "singular_chain p (subtopology X S) c \<Longrightarrow> singular_relboundary p X S c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_chain p (subtopology X S) c \<Longrightarrow> singular_relboundary p X S c
[PROOF STEP]
unfolding singular_relboundary_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_chain p (subtopology X S) c \<Longrightarrow> \<exists>d. singular_chain (Suc p) X d \<and> (chain_boundary (Suc p) d, c) \<in> mod_subset p (subtopology X S)
[PROOF STEP]
using mod_subset_def singular_chain_minus
[PROOF STATE]
proof (prove)
using this:
mod_subset ?p ?X \<equiv> {(a, b). singular_chain ?p ?X (a - b)}
singular_chain ?p ?X (- ?c) = singular_chain ?p ?X ?c

goal (1 subgoal):
 1. singular_chain p (subtopology X S) c \<Longrightarrow> \<exists>d. singular_chain (Suc p) X d \<and> (chain_boundary (Suc p) d, c) \<in> mod_subset p (subtopology X S)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma interfree_swap_Map: "\<forall>k. i\<le>k \<and> k<j \<longrightarrow> interfree_aux (com x, post x, c k)
 \<and> interfree_aux (c k, Q k, com x)
 \<Longrightarrow> interfree_swap (x, map (\<lambda>k. (c k, Q k)) [i..<j])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k. i \<le> k \<and> k < j \<longrightarrow> interfree_aux (OG_Hoare.com x, OG_Hoare.post x, c k) \<and> interfree_aux (c k, Q k, OG_Hoare.com x) \<Longrightarrow> interfree_swap (x, map (\<lambda>k. (c k, Q k)) [i..<j])
[PROOF STEP]
by(force simp add: interfree_swap_def less_diff_conv)


[STATEMENT]
lemma count_sum_mset: "count (sum_mset X) x = (\<Sum>Y\<in>#X. count Y x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (\<Sum>\<^sub># X) x = (\<Sum>Y\<in>#X. count Y x)
[PROOF STEP]
by (induction X) auto


[STATEMENT]
lemma matrix_to_iarray_echelon_form_of[code_unfold]:
  "matrix_to_iarray (echelon_form_of A bezout)
    = echelon_form_of_iarrays (matrix_to_iarray A) bezout"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (echelon_form_of A bezout) = echelon_form_of_iarrays (matrix_to_iarray A) bezout
[PROOF STEP]
unfolding echelon_form_of_def echelon_form_of_iarrays_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (echelon_form_of_upt_k A (ncols A - 1) bezout) = echelon_form_of_upt_k_iarrays (matrix_to_iarray A) (ncols_iarray (matrix_to_iarray A) - 1) bezout
[PROOF STEP]
by (metis (poly_guards_query) One_nat_def diff_less lessI matrix_to_iarray_echelon_form_of_upt_k
    ncols_def ncols_eq_card_columns zero_less_card_finite)


[STATEMENT]
lemma disj_eq_distribR: "((a \<or> c) = (b \<or> c)) = ((a = b) \<or> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((a \<or> c) = (b \<or> c)) = (a = b \<or> c)
[PROOF STEP]
by blast


[STATEMENT]
lemma transpose_mat_append_rows:
 assumes A: "A \<in> carrier_mat a n" and B: "B \<in> carrier_mat b n"
 shows "(A @\<^sub>r B)\<^sup>T = A\<^sup>T @\<^sub>c B\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>r B)\<^sup>T = A\<^sup>T @\<^sub>c B\<^sup>T
[PROOF STEP]
by (smt append_cols_def append_rows_def A B carrier_matD(1) index_transpose_mat(3)
      transpose_four_block_mat zero_carrier_mat zero_transpose_mat)


[STATEMENT]
lemma ngba_g_rtrancl_path: "(g_E (ngba_g A))\<^sup>* = {(p, target r p) |r p. NGBA.path A r p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g_E (ngba_g A))\<^sup>* = {(p, target r p) |r p. NGBA.path A r p}
[PROOF STEP]
unfolding ngba_g_E_rtrancl
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(p, q). q \<in> reachable A p} = {(p, target r p) |r p. NGBA.path A r p}
[PROOF STEP]
by blast


[STATEMENT]
lemma ccos_eq_minus1:
  fixes z::complex
  shows "cos z = -1 \<longleftrightarrow> (\<exists>n::int. z = complex_of_real(2 * n * pi) + pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cos z = - 1) = (\<exists>x. z = complex_of_real (2 * real_of_int x * pi) + complex_of_real pi)
[PROOF STEP]
using csin_eq_1 [of "z - of_real pi/2"]
[PROOF STATE]
proof (prove)
using this:
(sin (z - complex_of_real pi / 2) = 1) = (\<exists>x. z - complex_of_real pi / 2 = complex_of_real (2 * real_of_int x * pi) + complex_of_real pi / 2)

goal (1 subgoal):
 1. (cos z = - 1) = (\<exists>x. z = complex_of_real (2 * real_of_int x * pi) + complex_of_real pi)
[PROOF STEP]
by (simp add: sin_diff algebra_simps equation_minus_iff)


[STATEMENT]
lemma inj_image_filter_cartesian_product_alt:
    "inj_image_filter_cartesian_product f s1 s2 ==
     iterate_to_set s3.empty s3.ins_dj (set_iterator_image_filter f (
       set_iterator_product (s1.iteratei s1) (\<lambda>_. s2.iteratei s2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_image_filter_cartesian_product f s1 s2 \<equiv> iterate_to_set s3.empty s3.ins_dj (set_iterator_image_filter f (set_iterator_product (s1.iteratei s1) (\<lambda>_. s2.iteratei s2)))
[PROOF STEP]
unfolding inj_image_filter_cartesian_product_def iterate_to_set_alt_def
      set_iterator_image_filter_def set_iterator_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s1.iterate s1 (\<lambda>x. s2.iterate s2 (\<lambda>y res. case f (x, y) of None \<Rightarrow> res | Some z \<Rightarrow> s3.ins_dj z res)) (s3.empty ()) \<equiv> s1.iterate s1 (\<lambda>a. s2.iterate s2 (\<lambda>b \<sigma>. case f (a, b) of None \<Rightarrow> \<sigma> | Some x' \<Rightarrow> s3.ins_dj x' \<sigma>)) (s3.empty ())
[PROOF STEP]
by simp


[STATEMENT]
lemma rev_curr_app_FinFunc[elim!]:
  "\<lbrakk>f \<in> FinFunc r (s *o t); z \<in> Field t\<rbrakk> \<Longrightarrow> rev_curr f z \<in> FinFunc r s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> FinFunc r (s *o t); z \<in> Field t\<rbrakk> \<Longrightarrow> local.rev_curr f z \<in> FinFunc r s
[PROOF STEP]
unfolding rev_curr_def FinFunc_def Func_def Field_oprod fin_support_def support_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {f. (\<forall>a\<in>Field s \<times> Field t. f a \<in> Field r) \<and> (\<forall>a. a \<notin> Field s \<times> Field t \<longrightarrow> f a = undefined)} \<inter> {f. finite {x \<in> Field s \<times> Field t. f x \<noteq> zero r}}; z \<in> Field t\<rbrakk> \<Longrightarrow> (if z \<in> Field t then \<lambda>a. f (a, z) else undefined) \<in> {f. (\<forall>a\<in>Field s. f a \<in> Field r) \<and> (\<forall>a. a \<notin> Field s \<longrightarrow> f a = undefined)} \<inter> {f. finite {x \<in> Field s. f x \<noteq> zero r}}
[PROOF STEP]
by (auto elim: finite_surj)


[STATEMENT]
lemma (in Ring) ideal_prod_prime:"\<lbrakk>ideal R I; ideal R J; prime_ideal R P;
                          I \<diamondsuit>\<^sub>r J \<subseteq> P \<rbrakk> \<Longrightarrow> I \<subseteq> P \<or> J \<subseteq> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; ideal R J; prime_ideal R P; I \<diamondsuit>\<^sub>r J \<subseteq> P\<rbrakk> \<Longrightarrow> I \<subseteq> P \<or> J \<subseteq> P
[PROOF STEP]
apply (rule contrapos_pp, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; ideal R J; prime_ideal R P; I \<diamondsuit>\<^sub>r J \<subseteq> P; \<not> I \<subseteq> P \<and> \<not> J \<subseteq> P\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (erule conjE, simp add:subset_eq, (erule bexE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>ideal R I; ideal R J; prime_ideal R P; \<forall>x\<in>I \<diamondsuit>\<^sub>r J. x \<in> P; x \<in> I; x \<notin> P; xa \<in> J; xa \<notin> P\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule_tac i = x and j = xa in prod_mem_prod_ideals[of "I" "J"],
          assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>ideal R I; ideal R J; prime_ideal R P; \<forall>x\<in>I \<diamondsuit>\<^sub>r J. x \<in> P; x \<in> I; x \<notin> P; xa \<in> J; xa \<notin> P; x \<cdot>\<^sub>r xa \<in> I \<diamondsuit>\<^sub>r J\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule_tac x = "x \<cdot>\<^sub>r xa" in bspec, assumption,
        thin_tac "\<forall>x\<in>I \<diamondsuit>\<^sub>r\<^bsub> R\<^esub> J. x \<in> P")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>ideal R I; ideal R J; prime_ideal R P; x \<in> I; x \<notin> P; xa \<in> J; xa \<notin> P; x \<cdot>\<^sub>r xa \<in> I \<diamondsuit>\<^sub>r J; x \<cdot>\<^sub>r xa \<in> P\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add: prime_ideal_def, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>ideal R I; ideal R J; x \<in> I; x \<notin> P; xa \<in> J; xa \<notin> P; x \<cdot>\<^sub>r xa \<in> I \<diamondsuit>\<^sub>r J; x \<cdot>\<^sub>r xa \<in> P; ideal R P; 1\<^sub>r \<notin> P; \<forall>x\<in>carrier R. \<forall>y\<in>carrier R. x \<cdot>\<^sub>r y \<in> P \<longrightarrow> x \<in> P \<or> y \<in> P\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule_tac h = x in ideal_subset, assumption,
        frule_tac x = x in bspec, assumption,
        thin_tac "\<forall>x\<in>carrier R. \<forall>y\<in>carrier R. x \<cdot>\<^sub>r y \<in> P \<longrightarrow> x \<in> P \<or> y \<in> P",
        frule_tac h = xa in ideal_subset, assumption,
        frule_tac x = xa in bspec, assumption,
        thin_tac "\<forall>y\<in>carrier R. x \<cdot>\<^sub>r y \<in> P \<longrightarrow> x \<in> P \<or> y \<in> P",
        simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma unit_disc_fix_id_moebius [simp]:
  shows "unit_disc_fix id_moebius"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix id_moebius
[PROOF STEP]
by (transfer, transfer, simp add: unitary11_gen_def mat_adj_def mat_cnj_def)


[STATEMENT]
lemma carrier_eq: "carrier = {x. le x x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier = {x. le x x}
[PROOF STEP]
using not_outside refl
[PROOF STATE]
proof (prove)
using this:
le ?x ?y \<Longrightarrow> ?x \<in> carrier
le ?x ?y \<Longrightarrow> ?y \<in> carrier
?x \<in> carrier \<Longrightarrow> le ?x ?x

goal (1 subgoal):
 1. carrier = {x. le x x}
[PROOF STEP]
by auto


[STATEMENT]
lemma ennreal_inverse_power: "inverse (x ^ n :: ennreal) = inverse x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (x ^ n) = inverse x ^ n
[PROOF STEP]
proof (cases x rule: ennreal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. \<lbrakk>0 \<le> r; x = ennreal r\<rbrakk> \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
 2. x = top \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
[PROOF STEP]
case top
[PROOF STATE]
proof (state)
this:
x = top

goal (2 subgoals):
 1. \<And>r. \<lbrakk>0 \<le> r; x = ennreal r\<rbrakk> \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
 2. x = top \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
[PROOF STEP]
with power_eq_top_ennreal[of x n]
[PROOF STATE]
proof (chain)
picking this:
(x ^ n = top) = (n \<noteq> 0 \<and> x = top)
x = top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(x ^ n = top) = (n \<noteq> 0 \<and> x = top)
x = top

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

goal (1 subgoal):
 1. \<And>r. \<lbrakk>0 \<le> r; x = ennreal r\<rbrakk> \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>0 \<le> r; x = ennreal r\<rbrakk> \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
[PROOF STEP]
case (real r)
[PROOF STATE]
proof (state)
this:
0 \<le> r
x = ennreal r

goal (1 subgoal):
 1. \<And>r. \<lbrakk>0 \<le> r; x = ennreal r\<rbrakk> \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> r
x = ennreal r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> r
x = ennreal r

goal (1 subgoal):
 1. inverse (x ^ n) = inverse x ^ n
[PROOF STEP]
proof (cases "x = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>0 \<le> r; x = ennreal r; x = 0\<rbrakk> \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
 2. \<lbrakk>0 \<le> r; x = ennreal r; x \<noteq> 0\<rbrakk> \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> 0

goal (2 subgoals):
 1. \<lbrakk>0 \<le> r; x = ennreal r; x = 0\<rbrakk> \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
 2. \<lbrakk>0 \<le> r; x = ennreal r; x \<noteq> 0\<rbrakk> \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. inverse (x ^ n) = inverse x ^ n
[PROOF STEP]
by (smt (verit, best) ennreal_0 ennreal_power inverse_ennreal
               inverse_nonnegative_iff_nonnegative power_inverse real zero_less_power)
[PROOF STATE]
proof (state)
this:
inverse (x ^ n) = inverse x ^ n

goal (1 subgoal):
 1. \<lbrakk>0 \<le> r; x = ennreal r; x = 0\<rbrakk> \<Longrightarrow> inverse (x ^ n) = inverse x ^ n
[PROOF STEP]
qed (simp add: top_power_ennreal)
[PROOF STATE]
proof (state)
this:
inverse (x ^ n) = inverse x ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_univ_poly_mult:
  assumes "i \<le> n"
  assumes "p \<in> carrier (R[\<X>\<^bsub>Suc n\<^esub>])"
  assumes "Q \<in> carrier (R[\<X>\<^bsub>Suc n\<^esub>])"
  shows "to_univ_poly (Suc n) i (p \<otimes>\<^bsub>R[\<X>\<^bsub>Suc n\<^esub>]\<^esub>Q) =
        to_univ_poly (Suc n) i p \<otimes>\<^bsub>UP (R[\<X>\<^bsub>n\<^esub>])\<^esub> to_univ_poly (Suc n) i Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_univ_poly (Suc n) i (p \<otimes>\<^bsub>R [\<X>\<^bsub>Suc n\<^esub>]\<^esub> Q) = to_univ_poly (Suc n) i p \<otimes>\<^bsub>UP (R [\<X>\<^bsub>n\<^esub>])\<^esub> to_univ_poly (Suc n) i Q
[PROOF STEP]
using to_univ_poly_is_hom ring_hom_mult
[PROOF STATE]
proof (prove)
using this:
?i \<le> ?n \<Longrightarrow> to_univ_poly (Suc ?n) ?i \<in> ring_hom (R [\<X>\<^bsub>Suc ?n\<^esub>]) (UP (R [\<X>\<^bsub>?n\<^esub>]))
\<lbrakk>?h \<in> ring_hom ?R ?S; ?x \<in> carrier ?R; ?y \<in> carrier ?R\<rbrakk> \<Longrightarrow> ?h (?x \<otimes>\<^bsub>?R\<^esub> ?y) = ?h ?x \<otimes>\<^bsub>?S\<^esub> ?h ?y

goal (1 subgoal):
 1. to_univ_poly (Suc n) i (p \<otimes>\<^bsub>R [\<X>\<^bsub>Suc n\<^esub>]\<^esub> Q) = to_univ_poly (Suc n) i p \<otimes>\<^bsub>UP (R [\<X>\<^bsub>n\<^esub>])\<^esub> to_univ_poly (Suc n) i Q
[PROOF STEP]
by (metis assms(1) assms(2) assms(3))


[STATEMENT]
lemma less_le_mult_nat':
  "w * c < b * c ==> 0 \<le> c ==> Suc w * c \<le> b * (c::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w * c < b * c; 0 \<le> c\<rbrakk> \<Longrightarrow> Suc w * c \<le> b * c
[PROOF STEP]
apply (rule mult_right_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>w * c < b * c; 0 \<le> c\<rbrakk> \<Longrightarrow> Suc w \<le> b
 2. \<lbrakk>w * c < b * c; 0 \<le> c\<rbrakk> \<Longrightarrow> 0 \<le> c
[PROOF STEP]
apply (rule Suc_leI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>w * c < b * c; 0 \<le> c\<rbrakk> \<Longrightarrow> w < b
 2. \<lbrakk>w * c < b * c; 0 \<le> c\<rbrakk> \<Longrightarrow> 0 \<le> c
[PROOF STEP]
apply (erule (1) mult_right_less_imp_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w * c < b * c; 0 \<le> c\<rbrakk> \<Longrightarrow> 0 \<le> c
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in Module) mHom_test:"\<lbrakk>R module N; f \<in> carrier M \<rightarrow> carrier N \<and>
      f \<in> extensional (carrier M) \<and>
     (\<forall>m\<in>carrier M. \<forall>n\<in>carrier M. f (m \<plusminus>\<^bsub>M\<^esub> n) = f m \<plusminus>\<^bsub>N\<^esub> (f n)) \<and>
     (\<forall>a\<in>carrier R. \<forall>m\<in>carrier M. f (a \<cdot>\<^sub>s\<^bsub>M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>N\<^esub> (f m))\<rbrakk> \<Longrightarrow>
     f \<in> mHom R M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> carrier M \<rightarrow> carrier N \<and> f \<in> extensional (carrier M) \<and> (\<forall>m\<in>carrier M. \<forall>n\<in>carrier M. f (m \<plusminus> n) = f m \<plusminus>\<^bsub>N\<^esub> f n) \<and> (\<forall>a\<in>carrier R. \<forall>m\<in>carrier M. f (a \<cdot>\<^sub>s m) = a \<cdot>\<^sub>s\<^bsub>N\<^esub> f m)\<rbrakk> \<Longrightarrow> f \<in> mHom R M N
[PROOF STEP]
apply (simp add:mHom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> carrier M \<rightarrow> carrier N \<and> f \<in> extensional (carrier M) \<and> (\<forall>m\<in>carrier M. \<forall>n\<in>carrier M. f (m \<plusminus> n) = f m \<plusminus>\<^bsub>N\<^esub> f n) \<and> (\<forall>a\<in>carrier R. \<forall>m\<in>carrier M. f (a \<cdot>\<^sub>s m) = a \<cdot>\<^sub>s\<^bsub>N\<^esub> f m)\<rbrakk> \<Longrightarrow> f \<in> aHom M N
[PROOF STEP]
apply (simp add:aHom_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma continuous_at_avoid:
  fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space"
  assumes "continuous (at x) f"
    and "f x \<noteq> a"
  shows "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a
[PROOF STEP]
using assms continuous_within_avoid[of x UNIV f a]
[PROOF STATE]
proof (prove)
using this:
isCont f x
f x \<noteq> a
\<lbrakk>isCont f x; f x \<noteq> a\<rbrakk> \<Longrightarrow> \<exists>e>0. \<forall>y\<in>UNIV. dist x y < e \<longrightarrow> f y \<noteq> a

goal (1 subgoal):
 1. \<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a
[PROOF STEP]
by simp


[STATEMENT]
lemma less_eq_dual_def_var: "(x \<le> y) = (\<partial>\<^sup>- y \<le> \<partial>\<^sup>- x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y) = (\<partial>\<^sup>- y \<le> \<partial>\<^sup>- x)
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (x \<le> y) \<le> (\<partial>\<^sup>- y \<le> \<partial>\<^sup>- x)
 2. (\<partial>\<^sup>- y \<le> \<partial>\<^sup>- x) \<le> (x \<le> y)
[PROOF STEP]
apply (simp add: dual.rel_sel less_eq_dual_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<partial>\<^sup>- y \<le> \<partial>\<^sup>- x) \<le> (x \<le> y)
[PROOF STEP]
by (simp add: dual.rel_sel less_eq_dual_def)


[STATEMENT]
lemma smallo_imp_abs_less_real:
  assumes "f \<in> o[F](g)" "eventually (\<lambda>x. g x > (0::real)) F"
  shows   "eventually (\<lambda>x. \<bar>f x\<bar> < g x) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<bar>f x\<bar> < g x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<bar>f x\<bar> < g x
[PROOF STEP]
have "1/2 > (0::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 1 / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<bar>f x\<bar> < g x
[PROOF STEP]
from landau_o.smallD[OF assms(1) this] assms(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. norm (f x) \<le> 1 / 2 * norm (g x)
\<forall>\<^sub>F x in F. 0 < g x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (f x) \<le> 1 / 2 * norm (g x)
\<forall>\<^sub>F x in F. 0 < g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<bar>f x\<bar> < g x
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. \<bar>f x\<bar> < g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_of_uint32_mult: "int_of_uint32 (x * y) = (int_of_uint32 x * int_of_uint32 y) mod 4294967296"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_uint32 (x * y) = int_of_uint32 x * int_of_uint32 y mod 4294967296
[PROOF STEP]
by (transfer, unfold uint_word_ariths two_32, rule refl)


[STATEMENT]
lemma nsets_self [simp]: "nsets {..<m} m = {{..<m}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [{..<m}]\<^bsup>m\<^esup> = {{..<m}}
[PROOF STEP]
unfolding nsets_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {N. N \<subseteq> {..<m} \<and> finite N \<and> card N = m} = {{..<m}}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<subseteq> {..<card x}; finite x; m = card x; xa < card x\<rbrakk> \<Longrightarrow> xa \<in> x
[PROOF STEP]
by (metis add.left_neutral lessThan_atLeast0 lessThan_iff subset_card_intvl_is_intvl)


[STATEMENT]
lemma sigma_over_set_partition_count:
  assumes "finite A"
  assumes "partition_on A P"
  assumes "x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))"
  shows "count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
have disj: "disjoint P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjoint P
[PROOF STEP]
using assms partition_onD2
[PROOF STATE]
proof (prove)
using this:
finite A
partition_on A P
x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
partition_on ?A ?P \<Longrightarrow> disjoint ?P

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

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
disjoint P
[PROOF STEP]
obtain p where  pin: "p \<in># mset_set (mset_set ` P)" and xin: "x \<in># p"
[PROOF STATE]
proof (prove)
using this:
disjoint P

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p \<in># mset_set (mset_set ` P); x \<in># p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
disjoint P
finite A
partition_on A P
x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p \<in># mset_set (mset_set ` P); x \<in># p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p \<in># mset_set (mset_set ` P)
x \<in># p

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in># mset_set (mset_set ` P)
x \<in># p
[PROOF STEP]
have "count (mset_set (mset_set ` P)) p = 1"
[PROOF STATE]
proof (prove)
using this:
p \<in># mset_set (mset_set ` P)
x \<in># p

goal (1 subgoal):
 1. count (mset_set (mset_set ` P)) p = 1
[PROOF STEP]
by (meson count_eq_zero_iff count_mset_set')
[PROOF STATE]
proof (state)
this:
count (mset_set (mset_set ` P)) p = 1

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
count (mset_set (mset_set ` P)) p = 1
[PROOF STEP]
have filter: "\<And> p' . p' \<in># ((mset_set (mset_set` P)) - {#p#}) \<Longrightarrow> p \<noteq> p'"
[PROOF STATE]
proof (prove)
using this:
count (mset_set (mset_set ` P)) p = 1

goal (1 subgoal):
 1. \<And>p'. p' \<in># remove1_mset p (mset_set (mset_set ` P)) \<Longrightarrow> p \<noteq> p'
[PROOF STEP]
using count_eq_zero_iff count_single
[PROOF STATE]
proof (prove)
using this:
count (mset_set (mset_set ` P)) p = 1
(count ?M ?x = 0) = (?x \<notin># ?M)
count {#?b#} ?a = (if ?b = ?a then 1 else 0)

goal (1 subgoal):
 1. \<And>p'. p' \<in># remove1_mset p (mset_set (mset_set ` P)) \<Longrightarrow> p \<noteq> p'
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
?p' \<in># remove1_mset p (mset_set (mset_set ` P)) \<Longrightarrow> p \<noteq> ?p'

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
have zero: "\<And> p'. p' \<in># mset_set (mset_set ` P) \<Longrightarrow> p' \<noteq> p \<Longrightarrow> count p' x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p'. \<lbrakk>p' \<in># mset_set (mset_set ` P); p' \<noteq> p\<rbrakk> \<Longrightarrow> count p' x = 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p'. \<lbrakk>p' \<in># mset_set (mset_set ` P); p' \<noteq> p; count p' x \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix p'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p'. \<lbrakk>p' \<in># mset_set (mset_set ` P); p' \<noteq> p; count p' x \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume assm: "p' \<in># mset_set (mset_set ` P)" and ne: "p' \<noteq> p"  and n0: "count p' x \<noteq> 0"
[PROOF STATE]
proof (state)
this:
p' \<in># mset_set (mset_set ` P)
p' \<noteq> p
count p' x \<noteq> 0

goal (1 subgoal):
 1. \<And>p'. \<lbrakk>p' \<in># mset_set (mset_set ` P); p' \<noteq> p; count p' x \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p' \<in># mset_set (mset_set ` P)
p' \<noteq> p
count p' x \<noteq> 0
[PROOF STEP]
have xin2: "x \<in># p'"
[PROOF STATE]
proof (prove)
using this:
p' \<in># mset_set (mset_set ` P)
p' \<noteq> p
count p' x \<noteq> 0

goal (1 subgoal):
 1. x \<in># p'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in># p'

goal (1 subgoal):
 1. \<And>p'. \<lbrakk>p' \<in># mset_set (mset_set ` P); p' \<noteq> p; count p' x \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
obtain p1 p2 where p1in: "p1 \<in> P" and p2in: "p2 \<in> P" and  p1eq: "mset_set p1 = p"
        and p2eq: "mset_set p2 = p'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p1 p2. \<lbrakk>p1 \<in> P; p2 \<in> P; mset_set p1 = p; mset_set p2 = p'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assm assms(1) assms(2) pin
[PROOF STATE]
proof (prove)
using this:
p' \<in># mset_set (mset_set ` P)
finite A
partition_on A P
p \<in># mset_set (mset_set ` P)

goal (1 subgoal):
 1. (\<And>p1 p2. \<lbrakk>p1 \<in> P; p2 \<in> P; mset_set p1 = p; mset_set p2 = p'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (no_types, lifting) elem_mset_set finite_elements finite_imageI image_iff)
[PROOF STATE]
proof (state)
this:
p1 \<in> P
p2 \<in> P
mset_set p1 = p
mset_set p2 = p'

goal (1 subgoal):
 1. \<And>p'. \<lbrakk>p' \<in># mset_set (mset_set ` P); p' \<noteq> p; count p' x \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have origne: "p1 \<noteq> p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p1 \<noteq> p2
[PROOF STEP]
using ne p1eq p2eq
[PROOF STATE]
proof (prove)
using this:
p' \<noteq> p
mset_set p1 = p
mset_set p2 = p'

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

goal (1 subgoal):
 1. \<And>p'. \<lbrakk>p' \<in># mset_set (mset_set ` P); p' \<noteq> p; count p' x \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "p1 = p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p1 = p2
[PROOF STEP]
using partition_onD4 xin xin2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>partition_on ?A ?P; ?p \<in> ?P; ?q \<in> ?P; ?x \<in> ?p; ?x \<in> ?q\<rbrakk> \<Longrightarrow> ?p = ?q
x \<in># p
x \<in># p'

goal (1 subgoal):
 1. p1 = p2
[PROOF STEP]
by (metis assms(2) count_eq_zero_iff count_mset_set' p1eq p1in p2eq p2in)
[PROOF STATE]
proof (state)
this:
p1 = p2

goal (1 subgoal):
 1. \<And>p'. \<lbrakk>p' \<in># mset_set (mset_set ` P); p' \<noteq> p; count p' x \<noteq> 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p1 = p2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
p1 = p2

goal (1 subgoal):
 1. False
[PROOF STEP]
using origne
[PROOF STATE]
proof (prove)
using this:
p1 = p2
p1 \<noteq> p2

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?p' \<in># mset_set (mset_set ` P); ?p' \<noteq> p\<rbrakk> \<Longrightarrow> count ?p' x = 0

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
have one: "count p x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count p x = 1
[PROOF STEP]
using pin xin assms count_eq_zero_iff count_greater_eq_one_iff
[PROOF STATE]
proof (prove)
using this:
p \<in># mset_set (mset_set ` P)
x \<in># p
finite A
partition_on A P
x \<in># \<Sum>\<^sub># (mset_set (mset_set ` P))
(count ?M ?x = 0) = (?x \<notin># ?M)
(1 \<le> count ?M ?x) = (?x \<in># ?M)

goal (1 subgoal):
 1. count p x = 1
[PROOF STEP]
by (metis count_mset_set(3) count_mset_set_le_one image_iff le_antisym)
[PROOF STATE]
proof (state)
this:
count p x = 1

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
count p x = 1
[PROOF STEP]
have "count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x =
      (\<Sum>p' \<in># (mset_set (mset_set ` P)) . count p' x)"
[PROOF STATE]
proof (prove)
using this:
count p x = 1

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = (\<Sum>p'\<in>#mset_set (mset_set ` P). count p' x)
[PROOF STEP]
using count_sum_mset
[PROOF STATE]
proof (prove)
using this:
count p x = 1
count (\<Sum>\<^sub># ?M) ?b = (\<Sum>P\<in>#?M. count P ?b)

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = (\<Sum>p'\<in>#mset_set (mset_set ` P). count p' x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = (\<Sum>p'\<in>#mset_set (mset_set ` P). count p' x)

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = (\<Sum>p'\<in>#mset_set (mset_set ` P). count p' x)

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
have "... = (count p x) + (\<Sum>p' \<in># ((mset_set (mset_set ` P)) - {#p#}) . count p' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>p'\<in>#mset_set (mset_set ` P). count p' x) = count p x + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x)
[PROOF STEP]
by (metis (mono_tags, lifting) insert_DiffM pin sum_mset.insert)
[PROOF STATE]
proof (state)
this:
(\<Sum>p'\<in>#mset_set (mset_set ` P). count p' x) = count p x + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x)

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>p'\<in>#mset_set (mset_set ` P). count p' x) = count p x + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x)

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
have "... = 1 + (\<Sum>p' \<in># ((mset_set (mset_set ` P)) - {#p#}) . count p' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count p x + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x) = 1 + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x)
[PROOF STEP]
using one
[PROOF STATE]
proof (prove)
using this:
count p x = 1

goal (1 subgoal):
 1. count p x + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x) = 1 + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
count p x + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x) = 1 + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x)

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1 + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x)
[PROOF STEP]
have "count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x =
      1 + (\<Sum>p' \<in># ((mset_set (mset_set ` P)) - {#p#}) . 0)"
[PROOF STATE]
proof (prove)
using this:
count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1 + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x)

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1 + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). 0)
[PROOF STEP]
using zero filter
[PROOF STATE]
proof (prove)
using this:
count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1 + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). count p' x)
\<lbrakk>?p' \<in># mset_set (mset_set ` P); ?p' \<noteq> p\<rbrakk> \<Longrightarrow> count ?p' x = 0
?p' \<in># remove1_mset p (mset_set (mset_set ` P)) \<Longrightarrow> p \<noteq> ?p'

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1 + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). 0)
[PROOF STEP]
by (metis (mono_tags, lifting) in_diffD sum_over_fun_eq)
[PROOF STATE]
proof (state)
this:
count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1 + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). 0)

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1 + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). 0)
[PROOF STEP]
show "count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1"
[PROOF STATE]
proof (prove)
using this:
count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1 + (\<Sum>p'\<in>#remove1_mset p (mset_set (mset_set ` P)). 0)

goal (1 subgoal):
 1. count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count (\<Sum>\<^sub># (mset_set (mset_set ` P))) x = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma complex_positive_Im:
  fixes b::complex
  assumes "0 \<le> b"
  shows "Im b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im b = 0
[PROOF STEP]
by (metis assms less_eq_complex_def zero_complex.simps(2))


[STATEMENT]
lemma cspan_butterfly_ket: \<open>cspan {butterfly (ket i) (ket j)| (i::'b::finite) (j::'a::finite). True} = UNIV\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan {butterfly (ket i) (ket j) |i j. True} = UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cspan {butterfly (ket i) (ket j) |i j. True} = UNIV
[PROOF STEP]
have *: \<open>{butterfly (ket i) (ket j)| (i::'b::finite) (j::'a::finite). True} = {butterfly a b |a b. a \<in> range ket \<and> b \<in> range ket}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {butterfly (ket i) (ket j) |i j. True} = {butterfly a b |a b. a \<in> range ket \<and> b \<in> range ket}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{butterfly (ket i) (ket j) |i j. True} = {butterfly a b |a b. a \<in> range ket \<and> b \<in> range ket}

goal (1 subgoal):
 1. cspan {butterfly (ket i) (ket j) |i j. True} = UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan {butterfly (ket i) (ket j) |i j. True} = UNIV
[PROOF STEP]
apply (subst *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan {butterfly a b |a b. a \<in> range ket \<and> b \<in> range ket} = UNIV
[PROOF STEP]
apply (rule cspan_butterfly_UNIV)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. cspan (range ket) = UNIV
 2. cspan (range ket) = UNIV
 3. is_ortho_set (range ket)
 4. \<And>b. b \<in> range ket \<Longrightarrow> norm b = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cspan {butterfly (ket i) (ket j) |i j. True} = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordinal_order_trans: "(x::ordinal) \<le> y \<Longrightarrow> y \<le> z \<Longrightarrow> x \<le> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> y; y \<le> z\<rbrakk> \<Longrightarrow> x \<le> z
[PROOF STEP]
by (cases x, cases y, cases z, auto elim: ord0_order_trans)