[STATEMENT]
lemma generate_valid_topology_some_complies:
    "\<lbrakk> \<forall> (m_impl, m_spec) \<in> set M. SecurityInvariant_complies_formal_def m_impl m_spec;
       wf_list_graph (G::('v::vertex list_graph)) \<rbrakk> \<Longrightarrow>
       list_graph_to_graph (generate_valid_topology_some (get_impl M) G) =
       TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>(m_impl, m_spec)\<in>set M. SecurityInvariant_complies_formal_def m_impl m_spec; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
proof(induction M)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<forall>(x, y)\<in>set []. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl []) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec []) (edgesL G) (list_graph_to_graph G)
 2. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>set []. case a of (a, b) \<Rightarrow> SecurityInvariant_complies_formal_def a b
wf_list_graph G

goal (2 subgoals):
 1. \<lbrakk>\<forall>(x, y)\<in>set []. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl []) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec []) (edgesL G) (list_graph_to_graph G)
 2. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set []. case a of (a, b) \<Rightarrow> SecurityInvariant_complies_formal_def a b
wf_list_graph G

goal (1 subgoal):
 1. list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl []) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec []) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
by(simp add: get_spec_def get_impl_def)
[PROOF STATE]
proof (state)
this:
list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl []) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec []) (edgesL G) (list_graph_to_graph G)

goal (1 subgoal):
 1. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
case (Cons m M)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>a\<in>set M. case a of (a, b) \<Rightarrow> SecurityInvariant_complies_formal_def a b; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)
\<forall>a\<in>set (m # M). case a of (a, b) \<Rightarrow> SecurityInvariant_complies_formal_def a b
wf_list_graph G

goal (1 subgoal):
 1. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
obtain m_impl m_spec where m: "m = (m_impl, m_spec)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m_impl m_spec. m = (m_impl, m_spec) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(cases m) blast
[PROOF STATE]
proof (state)
this:
m = (m_impl, m_spec)

goal (1 subgoal):
 1. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
from m
[PROOF STATE]
proof (chain)
picking this:
m = (m_impl, m_spec)
[PROOF STEP]
have m_impl: "get_impl ((m_impl, m_spec) # M) = m_impl # (get_impl M)"
[PROOF STATE]
proof (prove)
using this:
m = (m_impl, m_spec)

goal (1 subgoal):
 1. get_impl ((m_impl, m_spec) # M) = m_impl # get_impl M
[PROOF STEP]
by (simp add: get_impl_def)
[PROOF STATE]
proof (state)
this:
get_impl ((m_impl, m_spec) # M) = m_impl # get_impl M

goal (1 subgoal):
 1. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
from m
[PROOF STATE]
proof (chain)
picking this:
m = (m_impl, m_spec)
[PROOF STEP]
have m_spec: "get_spec ((m_impl, m_spec) # M) = m_spec # (get_spec M)"
[PROOF STATE]
proof (prove)
using this:
m = (m_impl, m_spec)

goal (1 subgoal):
 1. get_spec ((m_impl, m_spec) # M) = m_spec # get_spec M
[PROOF STEP]
by (simp add: get_spec_def)
[PROOF STATE]
proof (state)
this:
get_spec ((m_impl, m_spec) # M) = m_spec # get_spec M

goal (1 subgoal):
 1. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
from Cons.prems(1) m
[PROOF STATE]
proof (chain)
picking this:
\<forall>a\<in>set (m # M). case a of (a, b) \<Rightarrow> SecurityInvariant_complies_formal_def a b
m = (m_impl, m_spec)
[PROOF STEP]
have complies_formal_def: "SecurityInvariant_complies_formal_def m_impl m_spec"
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set (m # M). case a of (a, b) \<Rightarrow> SecurityInvariant_complies_formal_def a b
m = (m_impl, m_spec)

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

goal (1 subgoal):
 1. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
with Cons.prems(2)
[PROOF STATE]
proof (chain)
picking this:
wf_list_graph G
SecurityInvariant_complies_formal_def m_impl m_spec
[PROOF STEP]
have impl_spec: "implc_sinvar m_impl G \<longleftrightarrow> c_sinvar m_spec (list_graph_to_graph G)"
[PROOF STATE]
proof (prove)
using this:
wf_list_graph G
SecurityInvariant_complies_formal_def m_impl m_spec

goal (1 subgoal):
 1. implc_sinvar m_impl G = c_sinvar m_spec (list_graph_to_graph G)
[PROOF STEP]
by (simp add: SecurityInvariant_complies_formal_def_def)
[PROOF STATE]
proof (state)
this:
implc_sinvar m_impl G = c_sinvar m_spec (list_graph_to_graph G)

goal (1 subgoal):
 1. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
from complies_formal_def
[PROOF STATE]
proof (chain)
picking this:
SecurityInvariant_complies_formal_def m_impl m_spec
[PROOF STEP]
have "\<And>G nP. wf_list_graph G \<Longrightarrow>
        (\<lambda>G nP. (c_sinvar m_spec) G) (list_graph_to_graph G) nP = (\<lambda>G nP. (implc_sinvar m_impl) G) G nP"
[PROOF STATE]
proof (prove)
using this:
SecurityInvariant_complies_formal_def m_impl m_spec

goal (1 subgoal):
 1. \<And>G nP. wf_list_graph G \<Longrightarrow> c_sinvar m_spec (list_graph_to_graph G) = implc_sinvar m_impl G
[PROOF STEP]
by (simp add: SecurityInvariant_complies_formal_def_def)
[PROOF STATE]
proof (state)
this:
wf_list_graph ?G \<Longrightarrow> c_sinvar m_spec (list_graph_to_graph ?G) = implc_sinvar m_impl ?G

goal (1 subgoal):
 1. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
from minimalize_offending_overapprox_spec_impl[OF Cons.prems(2),
          of "(\<lambda>G nP. (c_sinvar m_spec) G)" "(\<lambda>G nP. (implc_sinvar m_impl) G)", OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>G nP. wf_list_graph G \<Longrightarrow> wf_list_graph G) \<Longrightarrow> TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) ?fs ?keeps G = TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) ?fs ?keeps (list_graph_to_graph G)
[PROOF STEP]
(*TODO: because of funny type, horribly complex instantiation*)
[PROOF STATE]
proof (chain)
picking this:
(\<And>G nP. wf_list_graph G \<Longrightarrow> wf_list_graph G) \<Longrightarrow> TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) ?fs ?keeps G = TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) ?fs ?keeps (list_graph_to_graph G)
[PROOF STEP]
have "TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) fs keeps G =
            TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) fs keeps (list_graph_to_graph G)"
        for fs keeps
[PROOF STATE]
proof (prove)
using this:
(\<And>G nP. wf_list_graph G \<Longrightarrow> wf_list_graph G) \<Longrightarrow> TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) ?fs ?keeps G = TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) ?fs ?keeps (list_graph_to_graph G)

goal (1 subgoal):
 1. TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) fs keeps G = TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) fs keeps (list_graph_to_graph G)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) ?fs1 ?keeps1 G = TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) ?fs1 ?keeps1 (list_graph_to_graph G)

goal (1 subgoal):
 1. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
from this[of "(edgesL G)"  "[]"]
[PROOF STATE]
proof (chain)
picking this:
TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G = TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)
[PROOF STEP]
have minimalize_offending_overapprox_spec:
         "TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G =
          TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)"
[PROOF STATE]
proof (prove)
using this:
TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G = TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)

goal (1 subgoal):
 1. TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G = TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G = TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)

goal (1 subgoal):
 1. \<And>a M. \<lbrakk>\<lbrakk>\<forall>(x, y)\<in>set M. SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); \<forall>(x, y)\<in>set (a # M). SecurityInvariant_complies_formal_def x y; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (a # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (a # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
from Cons
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<forall>a\<in>set M. case a of (a, b) \<Rightarrow> SecurityInvariant_complies_formal_def a b; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)
\<forall>a\<in>set (m # M). case a of (a, b) \<Rightarrow> SecurityInvariant_complies_formal_def a b
wf_list_graph G
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>a\<in>set M. case a of (a, b) \<Rightarrow> SecurityInvariant_complies_formal_def a b; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)
\<forall>a\<in>set (m # M). case a of (a, b) \<Rightarrow> SecurityInvariant_complies_formal_def a b
wf_list_graph G

goal (1 subgoal):
 1. list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (m # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (m # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); (case m of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa) \<and> (\<forall>x\<in>set M. case x of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa); wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (m # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (m # M)) (edgesL G) (list_graph_to_graph G)
[PROOF STEP]
apply(simp add: m m_impl m_spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); SecurityInvariant_complies_formal_def m_impl m_spec \<and> (\<forall>x\<in>set M. case x of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa); wf_list_graph G\<rbrakk> \<Longrightarrow> (implc_sinvar m_impl G \<longrightarrow> \<not> c_sinvar m_spec (list_graph_to_graph G) \<longrightarrow> TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G) = FiniteGraph.delete_edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)) (set (TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)))) \<and> (\<not> implc_sinvar m_impl G \<longrightarrow> (c_sinvar m_spec (list_graph_to_graph G) \<longrightarrow> list_graph_to_graph (FiniteListGraph.delete_edges (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) (TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G)) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)) \<and> (\<not> c_sinvar m_spec (list_graph_to_graph G) \<longrightarrow> list_graph_to_graph (FiniteListGraph.delete_edges (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) (TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G)) = FiniteGraph.delete_edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)) (set (TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)))))
[PROOF STEP]
apply(intro conjI impI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); SecurityInvariant_complies_formal_def m_impl m_spec \<and> (\<forall>x\<in>set M. case x of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa); wf_list_graph G; implc_sinvar m_impl G; \<not> c_sinvar m_spec (list_graph_to_graph G)\<rbrakk> \<Longrightarrow> TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G) = FiniteGraph.delete_edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)) (set (TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)))
 2. \<lbrakk>list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); SecurityInvariant_complies_formal_def m_impl m_spec \<and> (\<forall>x\<in>set M. case x of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa); wf_list_graph G; \<not> implc_sinvar m_impl G; c_sinvar m_spec (list_graph_to_graph G)\<rbrakk> \<Longrightarrow> list_graph_to_graph (FiniteListGraph.delete_edges (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) (TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G)) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)
 3. \<lbrakk>list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); SecurityInvariant_complies_formal_def m_impl m_spec \<and> (\<forall>x\<in>set M. case x of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa); wf_list_graph G; \<not> implc_sinvar m_impl G; \<not> c_sinvar m_spec (list_graph_to_graph G)\<rbrakk> \<Longrightarrow> list_graph_to_graph (FiniteListGraph.delete_edges (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) (TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G)) = FiniteGraph.delete_edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)) (set (TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)))
[PROOF STEP]
apply (simp add: impl_spec; fail)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); SecurityInvariant_complies_formal_def m_impl m_spec \<and> (\<forall>x\<in>set M. case x of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa); wf_list_graph G; \<not> implc_sinvar m_impl G; c_sinvar m_spec (list_graph_to_graph G)\<rbrakk> \<Longrightarrow> list_graph_to_graph (FiniteListGraph.delete_edges (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) (TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G)) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)
 2. \<lbrakk>list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); SecurityInvariant_complies_formal_def m_impl m_spec \<and> (\<forall>x\<in>set M. case x of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa); wf_list_graph G; \<not> implc_sinvar m_impl G; \<not> c_sinvar m_spec (list_graph_to_graph G)\<rbrakk> \<Longrightarrow> list_graph_to_graph (FiniteListGraph.delete_edges (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) (TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G)) = FiniteGraph.delete_edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)) (set (TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)))
[PROOF STEP]
apply (simp add: impl_spec; fail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); SecurityInvariant_complies_formal_def m_impl m_spec \<and> (\<forall>x\<in>set M. case x of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa); wf_list_graph G; \<not> implc_sinvar m_impl G; \<not> c_sinvar m_spec (list_graph_to_graph G)\<rbrakk> \<Longrightarrow> list_graph_to_graph (FiniteListGraph.delete_edges (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) (TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G)) = FiniteGraph.delete_edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)) (set (TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)))
[PROOF STEP]
apply(simp add: delete_edges_correct[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G); SecurityInvariant_complies_formal_def m_impl m_spec \<and> (\<forall>x\<in>set M. case x of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa); wf_list_graph G; \<not> implc_sinvar m_impl G; \<not> c_sinvar m_spec (list_graph_to_graph G)\<rbrakk> \<Longrightarrow> FiniteGraph.delete_edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)) (set (TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G)) = FiniteGraph.delete_edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) (list_graph_to_graph G)) (set (TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)))
[PROOF STEP]
apply(simp add: list_graph_to_graph_def FiniteGraph.delete_edges_simp2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lparr>nodes = set (nodesL (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G)), edges = set (edgesL (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G))\<rparr> = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>; SecurityInvariant_complies_formal_def m_impl m_spec \<and> (\<forall>x\<in>set M. case x of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa); wf_list_graph G; \<not> implc_sinvar m_impl G; \<not> c_sinvar m_spec \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>\<rbrakk> \<Longrightarrow> edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>) - set (TopoS_Interface_impl.minimalize_offending_overapprox (implc_sinvar m_impl) (edgesL G) [] G) = edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>) - set (TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>)
[PROOF STEP]
apply(simp add: minimalize_offending_overapprox_spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lparr>nodes = set (nodesL (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G)), edges = set (edgesL (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl M) G))\<rparr> = TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>; SecurityInvariant_complies_formal_def m_impl m_spec \<and> (\<forall>x\<in>set M. case x of (x, xa) \<Rightarrow> SecurityInvariant_complies_formal_def x xa); wf_list_graph G; \<not> implc_sinvar m_impl G; \<not> c_sinvar m_spec \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>\<rbrakk> \<Longrightarrow> edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>) - set (TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] (list_graph_to_graph G)) = edges (TopoS_Composition_Theory.generate_valid_topology_some (get_spec M) (edgesL G) \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>) - set (TopoS_withOffendingFlows.minimalize_offending_overapprox (c_sinvar m_spec) (edgesL G) [] \<lparr>nodes = set (nodesL G), edges = set (edgesL G)\<rparr>)
[PROOF STEP]
by (simp add: list_graph_to_graph_def)
[PROOF STATE]
proof (state)
this:
list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology_some (get_impl (m # M)) G) = TopoS_Composition_Theory.generate_valid_topology_some (get_spec (m # M)) (edgesL G) (list_graph_to_graph G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ef_echelon_form_of_det:
  fixes A::"'a::{bezout_domain}^'n::{mod_type}^'n::{mod_type}"
  assumes ib: "is_bezout_ext bezout"
  shows "echelon_form (snd (echelon_form_of_det A bezout))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form (snd (echelon_form_of_det A bezout))
[PROOF STEP]
unfolding echelon_form_of_det_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (ncols A - 1)))
[PROOF STEP]
unfolding snd_echelon_form_of_upt_k_det_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form (echelon_form_of_upt_k A (ncols A - 1) bezout)
[PROOF STEP]
unfolding echelon_form_of_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form (echelon_form_of A bezout)
[PROOF STEP]
by (rule echelon_form_echelon_form_of[OF ib])


[STATEMENT]
lemma intpow_uminus: "x ^\<^sub>Z -n = inverse (x ^\<^sub>Z n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^\<^sub>Z - n = inverse (x ^\<^sub>Z n)
[PROOF STEP]
by (simp add: intpow_def)


[STATEMENT]
lemma (in is_functor) op_obj_cf_comma_is_iso_functor'[cat_comma_cs_intros]:
  assumes "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>"
    and "\<AA>' = op_cat (b \<down>\<^sub>C\<^sub>F \<FF>)"
    and "\<BB>' = (op_cf \<FF>) \<^sub>C\<^sub>F\<down> b"
  shows "op_obj_cf_comma b \<FF> : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<BB>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_obj_cf_comma b \<FF> : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<BB>'
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. op_obj_cf_comma b \<FF> : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> \<BB>'
[PROOF STEP]
unfolding assms(2,3)
[PROOF STATE]
proof (prove)
using this:
b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. op_obj_cf_comma b \<FF> : op_cat (b \<down>\<^sub>C\<^sub>F \<FF>) \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> (op_cf \<FF>) \<^sub>C\<^sub>F\<down> b
[PROOF STEP]
by (rule op_obj_cf_comma_is_iso_functor)


[STATEMENT]
lemma infinity_simps:
  "sign (plus_infinity::('e, 'f)float) = 0"
  "sign (minus_infinity::('e, 'f)float) = 1"
  "exponent (plus_infinity::('e, 'f)float) = emax TYPE(('e, 'f)float)"
  "exponent (minus_infinity::('e, 'f)float) = emax TYPE(('e, 'f)float)"
  "fraction (plus_infinity::('e, 'f)float) = 0"
  "fraction (minus_infinity::('e, 'f)float) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sign \<infinity> = 0 &&& sign (- \<infinity>) = 1 &&& IEEE.exponent \<infinity> = emax TYPE(('e, 'f) IEEE.float)) &&& IEEE.exponent (- \<infinity>) = emax TYPE(('e, 'f) IEEE.float) &&& fraction \<infinity> = 0 &&& fraction (- \<infinity>) = 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign \<infinity> = 0
[PROOF STEP]
by transfer auto
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. sign (- \<infinity>) = 1
 2. IEEE.exponent \<infinity> = emax TYPE(('e, 'f) IEEE.float)
 3. IEEE.exponent (- \<infinity>) = emax TYPE(('e, 'f) IEEE.float)
 4. fraction \<infinity> = 0
 5. fraction (- \<infinity>) = 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign (- \<infinity>) = 1
[PROOF STEP]
by transfer auto
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. IEEE.exponent \<infinity> = emax TYPE(('e, 'f) IEEE.float)
 2. IEEE.exponent (- \<infinity>) = emax TYPE(('e, 'f) IEEE.float)
 3. fraction \<infinity> = 0
 4. fraction (- \<infinity>) = 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IEEE.exponent \<infinity> = emax TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
by transfer (simp add: emax_def mask_eq_exp_minus_1)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. IEEE.exponent (- \<infinity>) = emax TYPE(('e, 'f) IEEE.float)
 2. fraction \<infinity> = 0
 3. fraction (- \<infinity>) = 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IEEE.exponent (- \<infinity>) = emax TYPE(('e, 'f) IEEE.float)
[PROOF STEP]
by transfer (simp add: emax_def mask_eq_exp_minus_1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. fraction \<infinity> = 0
 2. fraction (- \<infinity>) = 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fraction \<infinity> = 0
[PROOF STEP]
by transfer auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fraction (- \<infinity>) = 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fraction (- \<infinity>) = 0
[PROOF STEP]
by transfer auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma coeff_add: "coeff p m + coeff q m = coeff (p+q) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff p m + coeff q m = coeff (p + q) m
[PROOF STEP]
by (simp add: coeff_def lookup_add plus_mpoly.rep_eq)


[STATEMENT]
lemma "c < 0 \<Longrightarrow> ((\<lambda>x::real. exp (c*x)) \<longlongrightarrow> 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < 0 \<Longrightarrow> ((\<lambda>x. exp (c * x)) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma intersection_is_semialg:
  assumes "is_semialgebraic n A"
  assumes "is_semialgebraic n B"
  shows "is_semialgebraic n (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic n (A \<inter> B)
[PROOF STEP]
using assms(1) assms(2) is_semialgebraicE is_semialgebraicI semialg_intersect
[PROOF STATE]
proof (prove)
using this:
is_semialgebraic n A
is_semialgebraic n B
is_semialgebraic ?n ?S \<Longrightarrow> ?S \<in> semialg_sets ?n
?S \<in> semialg_sets ?n \<Longrightarrow> is_semialgebraic ?n ?S
\<lbrakk>?A \<in> semialg_sets ?n; ?B \<in> semialg_sets ?n\<rbrakk> \<Longrightarrow> ?A \<inter> ?B \<in> semialg_sets ?n

goal (1 subgoal):
 1. is_semialgebraic n (A \<inter> B)
[PROOF STEP]
by blast


[STATEMENT]
lemma minus_Int_eq:
  shows "T - (T - U) = T \<inter> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T - (T - U) = T \<inter> U
[PROOF STEP]
by blast


[STATEMENT]
lemma Ord_mem_iff_lt: "Ord k \<Longrightarrow> Ord l \<Longrightarrow> k \<in> elts l \<longleftrightarrow> k < l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord k; Ord l\<rbrakk> \<Longrightarrow> (k \<in> elts l) = (k < l)
[PROOF STEP]
by (metis Ord_linear OrdmemD less_le_not_le)


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


[STATEMENT]
lemma zeta_0 [simp]: "zeta 0 = -1 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zeta 0 = - 1 / 2
[PROOF STEP]
by (simp add: zeta_def)


[STATEMENT]
lemma Max_wrt_among_map_relation_bij_subset:
  assumes "bij (f :: 'a \<Rightarrow> 'b)"
  shows   "f ` Max_wrt_among le A \<subseteq>
             Max_wrt_among (map_relation (inv f) le) (f ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` Max_wrt_among le A \<subseteq> Max_wrt_among (map_relation (inv f) le) (f ` A)
[PROOF STEP]
using assms Max_wrt_among_map_relation_vimage[of "inv f" A]
[PROOF STATE]
proof (prove)
using this:
bij f
inv f -` Max_wrt_among le A \<subseteq> Max_wrt_among (map_relation (inv f) le) (inv f -` A)

goal (1 subgoal):
 1. f ` Max_wrt_among le A \<subseteq> Max_wrt_among (map_relation (inv f) le) (f ` A)
[PROOF STEP]
by (simp add: bij_imp_bij_inv inv_inv_eq bij_vimage_eq_inv_image)


[STATEMENT]
lemma mset_inter_filter: "{# a \<in># A . P a \<and> Q a #} = {# a \<in># A . P a #} \<inter># {# a \<in># A . Q a #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#a \<in># A. P a \<and> Q a#} = filter_mset P A \<inter># filter_mset Q A
[PROOF STEP]
by (rule multiset_eqI) simp


[STATEMENT]
lemma Beta_altdef: "Beta a b = Gamma a * Gamma b * rGamma (a + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Beta a b = Gamma a * Gamma b * rGamma (a + b)
[PROOF STEP]
by (simp add: inverse_eq_divide Beta_def Gamma_def)


[STATEMENT]
lemma union_scene_space_foldrs:
  assumes "set xs \<subseteq> set Vars" "set ys \<subseteq> set Vars"
  shows "(foldr (\<squnion>\<^sub>S) xs \<bottom>\<^sub>S) \<squnion>\<^sub>S (foldr (\<squnion>\<^sub>S) ys \<bottom>\<^sub>S) = foldr (\<squnion>\<^sub>S) (xs @ ys) \<bottom>\<^sub>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<squnion>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (xs @ ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> set Vars
set ys \<subseteq> set Vars

goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<squnion>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (xs @ ys)
[PROOF STEP]
apply (induct ys)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>set xs \<subseteq> set Vars; set [] \<subseteq> set Vars\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<squnion>\<^sub>S \<Squnion>\<^sub>S [] = \<Squnion>\<^sub>S (xs @ [])
 2. \<And>a ys. \<lbrakk>\<lbrakk>set xs \<subseteq> set Vars; set ys \<subseteq> set Vars\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<squnion>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (xs @ ys); set xs \<subseteq> set Vars; set (a # ys) \<subseteq> set Vars\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<squnion>\<^sub>S \<Squnion>\<^sub>S (a # ys) = \<Squnion>\<^sub>S (xs @ a # ys)
[PROOF STEP]
apply (simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ys. \<lbrakk>\<Squnion>\<^sub>S xs \<squnion>\<^sub>S \<Squnion>\<^sub>S ys = foldr (\<squnion>\<^sub>S) xs (\<Squnion>\<^sub>S ys); set xs \<subseteq> set Vars; a \<in> set Vars \<and> set ys \<subseteq> set Vars\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<squnion>\<^sub>S (a \<squnion>\<^sub>S \<Squnion>\<^sub>S ys) = foldr (\<squnion>\<^sub>S) xs (a \<squnion>\<^sub>S \<Squnion>\<^sub>S ys)
[PROOF STEP]
apply (metis Vars_compat_scene_space foldr_scene_union_add_tail local.indep_Vars pairwise_mono scene_indep_compat scene_indeps_def scene_space.Vars_scene_space scene_space.union_scene_space scene_space_foldr subset_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma minus_eq_enat_iff: "a - enat k = enat i \<longleftrightarrow> (\<exists>j. a = enat j \<and> j - k = i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - enat k = enat i) = (\<exists>j. a = enat j \<and> j - k = i)
[PROOF STEP]
by (cases a) auto


[STATEMENT]
lemma arcosh_real_def: "x \<ge> 1 \<Longrightarrow> arcosh (x::real) = ln (x + sqrt (x^2 - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> x \<Longrightarrow> arcosh x = ln (x + sqrt (x\<^sup>2 - 1))
[PROOF STEP]
by (simp add: arcosh_def powr_half_sqrt)


[STATEMENT]
lemma (in PolynRg) erH_minus:"\<lbrakk>Idomain S; PolynRg A B Y;
       h \<in> rHom S B; p \<in> carrier R\<rbrakk> \<Longrightarrow>
        erH R S X A B Y h (-\<^sub>a p) = -\<^sub>a\<^bsub>A\<^esub> (erH R S X A B Y h p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Idomain S; PolynRg A B Y; h \<in> rHom S B; p \<in> carrier R\<rbrakk> \<Longrightarrow> erH R S X A B Y h (-\<^sub>a p) = -\<^sub>a\<^bsub>A\<^esub> erH R S X A B Y h p
[PROOF STEP]
apply (frule erH_rHom[of A B Y h], assumption+,
       simp add:polyn_Hom_def, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Idomain S; PolynRg A B Y; h \<in> rHom S B; p \<in> carrier R; erH R S X A B Y h \<in> rHom R A; erH R S X A B Y h ` carrier S \<subseteq> carrier B; erH R S X A B Y h X = Y\<rbrakk> \<Longrightarrow> erH R S X A B Y h (-\<^sub>a p) = -\<^sub>a\<^bsub>A\<^esub> erH R S X A B Y h p
[PROOF STEP]
apply (frule PolynRg.is_Ring[of A B Y])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Idomain S; PolynRg A B Y; h \<in> rHom S B; p \<in> carrier R; erH R S X A B Y h \<in> rHom R A; erH R S X A B Y h ` carrier S \<subseteq> carrier B; erH R S X A B Y h X = Y; Ring A\<rbrakk> \<Longrightarrow> erH R S X A B Y h (-\<^sub>a p) = -\<^sub>a\<^bsub>A\<^esub> erH R S X A B Y h p
[PROOF STEP]
apply (rule rHom_inv_inv[of R A p "erH R S X A B Y h"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>Idomain S; PolynRg A B Y; h \<in> rHom S B; p \<in> carrier R; erH R S X A B Y h \<in> rHom R A; erH R S X A B Y h ` carrier S \<subseteq> carrier B; erH R S X A B Y h X = Y; Ring A\<rbrakk> \<Longrightarrow> Ring R
 2. \<lbrakk>Idomain S; PolynRg A B Y; h \<in> rHom S B; p \<in> carrier R; erH R S X A B Y h \<in> rHom R A; erH R S X A B Y h ` carrier S \<subseteq> carrier B; erH R S X A B Y h X = Y; Ring A\<rbrakk> \<Longrightarrow> Ring A
 3. \<lbrakk>Idomain S; PolynRg A B Y; h \<in> rHom S B; p \<in> carrier R; erH R S X A B Y h \<in> rHom R A; erH R S X A B Y h ` carrier S \<subseteq> carrier B; erH R S X A B Y h X = Y; Ring A\<rbrakk> \<Longrightarrow> p \<in> carrier R
 4. \<lbrakk>Idomain S; PolynRg A B Y; h \<in> rHom S B; p \<in> carrier R; erH R S X A B Y h \<in> rHom R A; erH R S X A B Y h ` carrier S \<subseteq> carrier B; erH R S X A B Y h X = Y; Ring A\<rbrakk> \<Longrightarrow> erH R S X A B Y h \<in> rHom R A
[PROOF STEP]
apply (cut_tac is_Ring, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in ring) weak_ring_morphism_ker:
  assumes "weak_ring_morphism f I R" shows "a_kernel R (image_ring f R) f = I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a_kernel R (image_ring f R) f = I
[PROOF STEP]
using add.weak_group_morphism_ker[OF weak_add_group_morphism[OF assms]]
[PROOF STATE]
proof (prove)
using this:
kernel (add_monoid R) (image_group f (add_monoid R)) f = I

goal (1 subgoal):
 1. a_kernel R (image_ring f R) f = I
[PROOF STEP]
unfolding kernel_def a_kernel_def' image_ring_def image_group_def
[PROOF STATE]
proof (prove)
using this:
{x \<in> carrier (add_monoid R). f x = \<one>\<^bsub>\<lparr>carrier = f ` carrier (add_monoid R), mult = \<lambda>a b. f (inv_into (carrier (add_monoid R)) f a \<otimes>\<^bsub>add_monoid R\<^esub> inv_into (carrier (add_monoid R)) f b), one = f \<one>\<^bsub>add_monoid R\<^esub>\<rparr>\<^esub>} = I

goal (1 subgoal):
 1. {x \<in> carrier R. f x = \<zero>\<^bsub>monoid.extend \<lparr>carrier = f ` carrier R, mult = \<lambda>a b. f (inv_into (carrier R) f a \<otimes> inv_into (carrier R) f b), one = f \<one>\<rparr> \<lparr>zero = f \<zero>, add = \<lambda>a b. f (inv_into (carrier R) f a \<oplus> inv_into (carrier R) f b)\<rparr>\<^esub>} = I
[PROOF STEP]
by (simp add: monoid.defs)


[STATEMENT]
lemma liminf_ereal_cminus:
  fixes f :: "nat \<Rightarrow> ereal"
  assumes "c \<noteq> -\<infinity>"
  shows "liminf (\<lambda>x. c - f x) = c - limsup f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>x. c - f x) = c - limsup f
[PROOF STEP]
proof (cases c)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>r. c = ereal r \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
 2. c = \<infinity> \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
 3. c = - \<infinity> \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
[PROOF STEP]
case PInf
[PROOF STATE]
proof (state)
this:
c = \<infinity>

goal (3 subgoals):
 1. \<And>r. c = ereal r \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
 2. c = \<infinity> \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
 3. c = - \<infinity> \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = \<infinity>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c = \<infinity>

goal (1 subgoal):
 1. liminf (\<lambda>x. c - f x) = c - limsup f
[PROOF STEP]
by (simp add: Liminf_const)
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>x. c - f x) = c - limsup f

goal (2 subgoals):
 1. \<And>r. c = ereal r \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
 2. c = - \<infinity> \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. c = ereal r \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
 2. c = - \<infinity> \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
[PROOF STEP]
case (real r)
[PROOF STATE]
proof (state)
this:
c = ereal r

goal (2 subgoals):
 1. \<And>r. c = ereal r \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
 2. c = - \<infinity> \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = ereal r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c = ereal r

goal (1 subgoal):
 1. liminf (\<lambda>x. c - f x) = c - limsup f
[PROOF STEP]
by (simp add: liminf_SUP_INF limsup_INF_SUP INF_ereal_minus_right SUP_ereal_minus_right)
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>x. c - f x) = c - limsup f

goal (1 subgoal):
 1. c = - \<infinity> \<Longrightarrow> liminf (\<lambda>x. c - f x) = c - limsup f
[PROOF STEP]
qed (use \<open>c \<noteq> -\<infinity>\<close> in simp)


[STATEMENT]
lemma Cauchy_has_contour_integral_higher_derivative_circlepath:
  assumes contf: "continuous_on (cball z r) f"
      and holf: "f holomorphic_on ball z r"
      and w: "w \<in> ball z r"
    shows "((\<lambda>u. f u / (u - w) ^ (Suc k)) has_contour_integral ((2 * pi * \<i>) / (fact k) * (deriv ^^ k) f w))
           (circlepath z r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r)
[PROOF STEP]
using w
[PROOF STATE]
proof (prove)
using this:
w \<in> ball z r

goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r)
[PROOF STEP]
proof (induction k arbitrary: w)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc 0) has_contour_integral complex_of_real (2 * pi) * \<i> / fact 0 * (deriv ^^ 0) f w) (circlepath z r)
 2. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
w \<in> ball z r

goal (2 subgoals):
 1. \<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc 0) has_contour_integral complex_of_real (2 * pi) * \<i> / fact 0 * (deriv ^^ 0) f w) (circlepath z r)
 2. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> ball z r
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
w \<in> ball z r

goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w) ^ Suc 0) has_contour_integral complex_of_real (2 * pi) * \<i> / fact 0 * (deriv ^^ 0) f w) (circlepath z r)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
w \<in> ball z r
continuous_on (cball z r) f
f holomorphic_on ball z r
w \<in> ball z r

goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w) ^ Suc 0) has_contour_integral complex_of_real (2 * pi) * \<i> / fact 0 * (deriv ^^ 0) f w) (circlepath z r)
[PROOF STEP]
by (auto simp: Cauchy_integral_circlepath dist_commute dist_norm)
[PROOF STATE]
proof (state)
this:
((\<lambda>u. f u / (u - w) ^ Suc 0) has_contour_integral complex_of_real (2 * pi) * \<i> / fact 0 * (deriv ^^ 0) f w) (circlepath z r)

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
?w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - ?w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f ?w) (circlepath z r)
w \<in> ball z r

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
have [simp]: "r > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < r
[PROOF STEP]
using w
[PROOF STATE]
proof (prove)
using this:
w \<in> ball z r

goal (1 subgoal):
 1. 0 < r
[PROOF STEP]
using ball_eq_empty
[PROOF STATE]
proof (prove)
using this:
w \<in> ball z r
(ball ?x ?e = {}) = (?e \<le> 0)

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

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
have f: "continuous_on (path_image (circlepath z r)) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (path_image (circlepath z r)) f
[PROOF STEP]
by (rule continuous_on_subset [OF contf]) (force simp: cball_def sphere_def less_imp_le)
[PROOF STATE]
proof (state)
this:
continuous_on (path_image (circlepath z r)) f

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
obtain X where X: "((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral X) (circlepath z r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral X) (circlepath z r) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Cauchy_next_derivative_circlepath(1) [OF f Suc.IH _ Suc.prems]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> w \<in> ball z r; Suc k \<noteq> 0\<rbrakk> \<Longrightarrow> (\<lambda>u. f u / (u - w) ^ Suc (Suc k)) contour_integrable_on circlepath z r

goal (1 subgoal):
 1. (\<And>X. ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral X) (circlepath z r) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: contour_integrable_on_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral X) (circlepath z r)

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral X) (circlepath z r)
[PROOF STEP]
have con: "contour_integral (circlepath z r) ((\<lambda>u. f u / (u - w) ^ Suc (Suc k))) = X"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral X) (circlepath z r)

goal (1 subgoal):
 1. contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc (Suc k)) = X
[PROOF STEP]
by (rule contour_integral_unique)
[PROOF STATE]
proof (state)
this:
contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc (Suc k)) = X

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
have "\<And>n. ((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) w) (at w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. ((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) w) (at w)
[PROOF STEP]
using Suc.prems assms has_field_derivative_higher_deriv
[PROOF STATE]
proof (prove)
using this:
w \<in> ball z r
continuous_on (cball z r) f
f holomorphic_on ball z r
w \<in> ball z r
\<lbrakk>?f holomorphic_on ?S; open ?S; ?x \<in> ?S\<rbrakk> \<Longrightarrow> ((deriv ^^ ?n) ?f has_field_derivative (deriv ^^ Suc ?n) ?f ?x) (at ?x)

goal (1 subgoal):
 1. \<And>n. ((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) w) (at w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((deriv ^^ ?n) f has_field_derivative deriv ((deriv ^^ ?n) f) w) (at w)

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((deriv ^^ ?n) f has_field_derivative deriv ((deriv ^^ ?n) f) w) (at w)
[PROOF STEP]
have dnf_diff: "\<And>n. (deriv ^^ n) f field_differentiable (at w)"
[PROOF STATE]
proof (prove)
using this:
((deriv ^^ ?n) f has_field_derivative deriv ((deriv ^^ ?n) f) w) (at w)

goal (1 subgoal):
 1. \<And>n. (deriv ^^ n) f field_differentiable at w
[PROOF STEP]
by (force simp: field_differentiable_def)
[PROOF STATE]
proof (state)
this:
(deriv ^^ ?n) f field_differentiable at w

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
have "deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / (fact k) * (deriv ^^ k) f w) w =
          of_nat (Suc k) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc (Suc k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) w = of_nat (Suc k) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc (Suc k))
[PROOF STEP]
by (force intro!: DERIV_imp_deriv Cauchy_next_derivative_circlepath [OF f Suc.IH _ Suc.prems])
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) w = of_nat (Suc k) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc (Suc k))

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) w = of_nat (Suc k) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc (Suc k))

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
have "\<dots> = of_nat (Suc k) * X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (Suc k) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc (Suc k)) = of_nat (Suc k) * X
[PROOF STEP]
by (simp only: con)
[PROOF STATE]
proof (state)
this:
of_nat (Suc k) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc (Suc k)) = of_nat (Suc k) * X

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) w = of_nat (Suc k) * X
[PROOF STEP]
have "deriv (\<lambda>w. ((2 * pi) * \<i> / (fact k)) * (deriv ^^ k) f w) w = of_nat (Suc k) * X"
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) w = of_nat (Suc k) * X

goal (1 subgoal):
 1. deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) w = of_nat (Suc k) * X
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) w = of_nat (Suc k) * X

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) w = of_nat (Suc k) * X
[PROOF STEP]
have "((2 * pi) * \<i> / (fact k)) * deriv (\<lambda>w. (deriv ^^ k) f w) w = of_nat (Suc k) * X"
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) w = of_nat (Suc k) * X

goal (1 subgoal):
 1. complex_of_real (2 * pi) * \<i> / fact k * deriv ((deriv ^^ k) f) w = of_nat (Suc k) * X
[PROOF STEP]
by (metis deriv_cmult dnf_diff)
[PROOF STATE]
proof (state)
this:
complex_of_real (2 * pi) * \<i> / fact k * deriv ((deriv ^^ k) f) w = of_nat (Suc k) * X

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
complex_of_real (2 * pi) * \<i> / fact k * deriv ((deriv ^^ k) f) w = of_nat (Suc k) * X
[PROOF STEP]
have "deriv (\<lambda>w. (deriv ^^ k) f w) w = of_nat (Suc k) * X / ((2 * pi) * \<i> / (fact k))"
[PROOF STATE]
proof (prove)
using this:
complex_of_real (2 * pi) * \<i> / fact k * deriv ((deriv ^^ k) f) w = of_nat (Suc k) * X

goal (1 subgoal):
 1. deriv ((deriv ^^ k) f) w = of_nat (Suc k) * X / (complex_of_real (2 * pi) * \<i> / fact k)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
deriv ((deriv ^^ k) f) w = of_nat (Suc k) * X / (complex_of_real (2 * pi) * \<i> / fact k)

goal (1 subgoal):
 1. \<And>k w. \<lbrakk>\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r); w \<in> ball z r\<rbrakk> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv ((deriv ^^ k) f) w = of_nat (Suc k) * X / (complex_of_real (2 * pi) * \<i> / fact k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
deriv ((deriv ^^ k) f) w = of_nat (Suc k) * X / (complex_of_real (2 * pi) * \<i> / fact k)

goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
using of_nat_eq_0_iff X
[PROOF STATE]
proof (prove)
using this:
deriv ((deriv ^^ k) f) w = of_nat (Suc k) * X / (complex_of_real (2 * pi) * \<i> / fact k)
(of_nat ?m = (0::?'a)) = (?m = 0)
((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral X) (circlepath z r)

goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral complex_of_real (2 * pi) * \<i> / fact (Suc k) * (deriv ^^ Suc k) f w) (circlepath z r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ang_circ_a_simp:
  assumes "E \<noteq> \<mu>1" and "E \<noteq> \<mu>2"
  shows "ang_circ_a E \<mu>1 \<mu>2 p1 p2 =
         acute_ang (abs (canon_ang (Arg(E - \<mu>2) - Arg(E - \<mu>1) + (sgn_bool p1) * pi/2 - (sgn_bool p2) * pi/2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ang_circ_a E \<mu>1 \<mu>2 p1 p2 = acute_ang \<bar>\<downharpoonright>Arg (E - \<mu>2) - Arg (E - \<mu>1) + sgn_bool p1 * pi / 2 - sgn_bool p2 * pi / 2\<downharpoonleft>\<bar>
[PROOF STEP]
unfolding ang_circ_a_def ang_vec_a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. acute_ang (\<angle>c (circ_tang_vec \<mu>1 E p1) (circ_tang_vec \<mu>2 E p2)) = acute_ang \<bar>\<downharpoonright>Arg (E - \<mu>2) - Arg (E - \<mu>1) + sgn_bool p1 * pi / 2 - sgn_bool p2 * pi / 2\<downharpoonleft>\<bar>
[PROOF STEP]
using ang_circ_c_simp[OF assms]
[PROOF STATE]
proof (prove)
using this:
ang_circ_c E \<mu>1 \<mu>2 ?p1.0 ?p2.0 = \<bar>\<downharpoonright>Arg (E - \<mu>2) - Arg (E - \<mu>1) + sgn_bool ?p1.0 * pi / 2 - sgn_bool ?p2.0 * pi / 2\<downharpoonleft>\<bar>

goal (1 subgoal):
 1. acute_ang (\<angle>c (circ_tang_vec \<mu>1 E p1) (circ_tang_vec \<mu>2 E p2)) = acute_ang \<bar>\<downharpoonright>Arg (E - \<mu>2) - Arg (E - \<mu>1) + sgn_bool p1 * pi / 2 - sgn_bool p2 * pi / 2\<downharpoonleft>\<bar>
[PROOF STEP]
unfolding ang_circ_c_def
[PROOF STATE]
proof (prove)
using this:
\<angle>c (circ_tang_vec \<mu>1 E ?p1.0) (circ_tang_vec \<mu>2 E ?p2.0) = \<bar>\<downharpoonright>Arg (E - \<mu>2) - Arg (E - \<mu>1) + sgn_bool ?p1.0 * pi / 2 - sgn_bool ?p2.0 * pi / 2\<downharpoonleft>\<bar>

goal (1 subgoal):
 1. acute_ang (\<angle>c (circ_tang_vec \<mu>1 E p1) (circ_tang_vec \<mu>2 E p2)) = acute_ang \<bar>\<downharpoonright>Arg (E - \<mu>2) - Arg (E - \<mu>1) + sgn_bool p1 * pi / 2 - sgn_bool p2 * pi / 2\<downharpoonleft>\<bar>
[PROOF STEP]
by auto


[STATEMENT]
lemma unat_mult_lem:
  "unat x * unat y < 2 ^ LENGTH('a) \<longleftrightarrow> unat (x * y) = unat x * unat y"
  for x y :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (unat x * unat y < 2 ^ LENGTH('a)) = (unat (x * y) = unat x * unat y)
[PROOF STEP]
by (metis mod_less unat_word_ariths(2) unsigned_less)


[STATEMENT]
lemma subspace_dual_space:
  "subspace (dual_space S)"
  if "subspace S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace (dual_space S)
[PROOF STEP]
unfolding dual_space_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace (Collect (linear_fun_on S) \<inter> Collect (extensional0 S))
[PROOF STEP]
apply (rule subspace_inter)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. subspace (Collect (linear_fun_on S))
 2. subspace (Collect (extensional0 S))
[PROOF STEP]
apply (rule subspace_linear_fun_on[OF that])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace (Collect (extensional0 S))
[PROOF STEP]
apply (rule subspace_extensional0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem eval_ifnz[simp]: assumes e1: "E(e1) = E(ENat n)" and nz: "n \<noteq> 0"
  shows "E(EIf e1 e2 e3) = E(e2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E (EIf e1 e2 e3) = E e2
[PROOF STEP]
using e1 nz
[PROOF STATE]
proof (prove)
using this:
E e1 = E (ENat n)
n \<noteq> 0

goal (1 subgoal):
 1. E (EIf e1 e2 e3) = E e2
[PROOF STEP]
by auto


[STATEMENT]
lemma prod_rel_simp[simp]:
  "((a,b),(a',b'))\<in>\<langle>R1,R2\<rangle>prod_rel \<longleftrightarrow> (a,a')\<in>R1 \<and> (b,b')\<in>R2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((a, b), a', b') \<in> R1 \<times>\<^sub>r R2) = ((a, a') \<in> R1 \<and> (b, b') \<in> R2)
[PROOF STEP]
by (auto intro: prod_relI elim: prod_relE)


[STATEMENT]
lemma poly_deg_prod_le: "((poly_deg (prod f A))::'a::add_linorder_min) \<le> (\<Sum>a\<in>A. poly_deg (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))
[PROOF STEP]
proof (cases "finite A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite A \<Longrightarrow> poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))
 2. infinite A \<Longrightarrow> poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite A

goal (2 subgoals):
 1. finite A \<Longrightarrow> poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))
 2. infinite A \<Longrightarrow> poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))
[PROOF STEP]
proof (induct A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly_deg (prod f {}) \<le> (\<Sum>a\<in>{}. poly_deg (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; poly_deg (prod f F) \<le> (\<Sum>a\<in>F. poly_deg (f a))\<rbrakk> \<Longrightarrow> poly_deg (prod f (insert x F)) \<le> (\<Sum>a\<in>insert x F. poly_deg (f a))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. poly_deg (prod f {}) \<le> (\<Sum>a\<in>{}. poly_deg (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; poly_deg (prod f F) \<le> (\<Sum>a\<in>F. poly_deg (f a))\<rbrakk> \<Longrightarrow> poly_deg (prod f (insert x F)) \<le> (\<Sum>a\<in>insert x F. poly_deg (f a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_deg (prod f {}) \<le> (\<Sum>a\<in>{}. poly_deg (f a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly_deg (prod f {}) \<le> (\<Sum>a\<in>{}. poly_deg (f a))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; poly_deg (prod f F) \<le> (\<Sum>a\<in>F. poly_deg (f a))\<rbrakk> \<Longrightarrow> poly_deg (prod f (insert x F)) \<le> (\<Sum>a\<in>insert x F. poly_deg (f a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; poly_deg (prod f F) \<le> (\<Sum>a\<in>F. poly_deg (f a))\<rbrakk> \<Longrightarrow> poly_deg (prod f (insert x F)) \<le> (\<Sum>a\<in>insert x F. poly_deg (f a))
[PROOF STEP]
case (insert a A)
[PROOF STATE]
proof (state)
this:
finite A
a \<notin> A
poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; poly_deg (prod f F) \<le> (\<Sum>a\<in>F. poly_deg (f a))\<rbrakk> \<Longrightarrow> poly_deg (prod f (insert x F)) \<le> (\<Sum>a\<in>insert x F. poly_deg (f a))
[PROOF STEP]
have "poly_deg (prod f (insert a A)) \<le> (poly_deg (f a)) + (poly_deg (prod f A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_deg (prod f (insert a A)) \<le> poly_deg (f a) + poly_deg (prod f A)
[PROOF STEP]
by (simp only: comm_monoid_mult_class.prod.insert[OF insert(1) insert(2)] poly_deg_times_le)
[PROOF STATE]
proof (state)
this:
poly_deg (prod f (insert a A)) \<le> poly_deg (f a) + poly_deg (prod f A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; poly_deg (prod f F) \<le> (\<Sum>a\<in>F. poly_deg (f a))\<rbrakk> \<Longrightarrow> poly_deg (prod f (insert x F)) \<le> (\<Sum>a\<in>insert x F. poly_deg (f a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly_deg (prod f (insert a A)) \<le> poly_deg (f a) + poly_deg (prod f A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; poly_deg (prod f F) \<le> (\<Sum>a\<in>F. poly_deg (f a))\<rbrakk> \<Longrightarrow> poly_deg (prod f (insert x F)) \<le> (\<Sum>a\<in>insert x F. poly_deg (f a))
[PROOF STEP]
have "... \<le> (poly_deg (f a)) + (\<Sum>a\<in>A. poly_deg (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_deg (f a) + poly_deg (prod f A) \<le> poly_deg (f a) + (\<Sum>a\<in>A. poly_deg (f a))
[PROOF STEP]
using insert(3) add_le_cancel_left
[PROOF STATE]
proof (prove)
using this:
poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))
(?c + ?a \<le> ?c + ?b) = (?a \<le> ?b)

goal (1 subgoal):
 1. poly_deg (f a) + poly_deg (prod f A) \<le> poly_deg (f a) + (\<Sum>a\<in>A. poly_deg (f a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
poly_deg (f a) + poly_deg (prod f A) \<le> poly_deg (f a) + (\<Sum>a\<in>A. poly_deg (f a))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; poly_deg (prod f F) \<le> (\<Sum>a\<in>F. poly_deg (f a))\<rbrakk> \<Longrightarrow> poly_deg (prod f (insert x F)) \<le> (\<Sum>a\<in>insert x F. poly_deg (f a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly_deg (f a) + poly_deg (prod f A) \<le> poly_deg (f a) + (\<Sum>a\<in>A. poly_deg (f a))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; poly_deg (prod f F) \<le> (\<Sum>a\<in>F. poly_deg (f a))\<rbrakk> \<Longrightarrow> poly_deg (prod f (insert x F)) \<le> (\<Sum>a\<in>insert x F. poly_deg (f a))
[PROOF STEP]
have "... = (\<Sum>a\<in>insert a A. poly_deg (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_deg (f a) + (\<Sum>a\<in>A. poly_deg (f a)) = (\<Sum>a\<in>insert a A. poly_deg (f a))
[PROOF STEP]
by (simp add: insert(1) insert(2))
[PROOF STATE]
proof (state)
this:
poly_deg (f a) + (\<Sum>a\<in>A. poly_deg (f a)) = (\<Sum>a\<in>insert a A. poly_deg (f a))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; poly_deg (prod f F) \<le> (\<Sum>a\<in>F. poly_deg (f a))\<rbrakk> \<Longrightarrow> poly_deg (prod f (insert x F)) \<le> (\<Sum>a\<in>insert x F. poly_deg (f a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly_deg (prod f (insert a A)) \<le> (\<Sum>a\<in>insert a A. poly_deg (f a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
poly_deg (prod f (insert a A)) \<le> (\<Sum>a\<in>insert a A. poly_deg (f a))

goal (1 subgoal):
 1. poly_deg (prod f (insert a A)) \<le> (\<Sum>a\<in>insert a A. poly_deg (f a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
poly_deg (prod f (insert a A)) \<le> (\<Sum>a\<in>insert a A. poly_deg (f a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))

goal (1 subgoal):
 1. infinite A \<Longrightarrow> poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite A \<Longrightarrow> poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite A

goal (1 subgoal):
 1. infinite A \<Longrightarrow> poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite A

goal (1 subgoal):
 1. poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly_deg (prod f A) \<le> (\<Sum>a\<in>A. poly_deg (f a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma emeasure_count_space_finite[simp]:
  "X \<subseteq> A \<Longrightarrow> finite X \<Longrightarrow> emeasure (count_space A) X = of_nat (card X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> A; finite X\<rbrakk> \<Longrightarrow> emeasure (count_space A) X = of_nat (card X)
[PROOF STEP]
using emeasure_count_space[of X A]
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> A \<Longrightarrow> emeasure (count_space A) X = (if finite X then of_nat (card X) else \<infinity>)

goal (1 subgoal):
 1. \<lbrakk>X \<subseteq> A; finite X\<rbrakk> \<Longrightarrow> emeasure (count_space A) X = of_nat (card X)
[PROOF STEP]
by simp


[STATEMENT]
lemma interior_translation_subtract:
  "interior ((\<lambda>x. x - a) ` S) = (\<lambda>x. x - a) ` interior S" for S :: "'a::real_normed_vector set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior ((\<lambda>x. x - a) ` S) = (\<lambda>x. x - a) ` interior S
[PROOF STEP]
using interior_translation [of "- a"]
[PROOF STATE]
proof (prove)
using this:
interior ((+) (- a) ` ?S) = (+) (- a) ` interior ?S

goal (1 subgoal):
 1. interior ((\<lambda>x. x - a) ` S) = (\<lambda>x. x - a) ` interior S
[PROOF STEP]
by (simp cong: image_cong_simp)


[STATEMENT]
lemma rtrancl_impl:
  "set_of (rtrancl_i rel as) = {b. (\<exists> a \<in> set as. (a, b) \<in> (set rel)\<^sup>*)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (rtrancl_i rel as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set rel)\<^sup>*}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_of (rtrancl_i rel as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set rel)\<^sup>*}
[PROOF STEP]
interpret set_access_succ set_of memb empty un "gen_succ rel" "set rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_access_succ set_of memb empty un (gen_succ rel) (set rel)
[PROOF STEP]
by (unfold_locales, insert gen_succ, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_of (rtrancl_i rel as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set rel)\<^sup>*}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (rtrancl_i rel as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set rel)\<^sup>*}
[PROOF STEP]
unfolding rtrancl_impl_def Let_def relpow_impl
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {uu_. \<exists>a b m. uu_ = b \<and> a \<in> set as \<and> m \<le> length rel \<and> (a, b) \<in> set rel ^^ m} = {b. \<exists>a\<in>set as. (a, b) \<in> (set rel)\<^sup>*}
[PROOF STEP]
by (auto simp: rtrancl_finite_relpow)
[PROOF STATE]
proof (state)
this:
set_of (rtrancl_i rel as) = {b. \<exists>a\<in>set as. (a, b) \<in> (set rel)\<^sup>*}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group_action) card_stablizer_sum:
  assumes "finite (carrier G)" "orb \<in> (orbits G E \<phi>)"
  shows "(\<Sum>x \<in> orb. card (stabilizer G \<phi> x)) = order G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = order G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = order G
[PROOF STEP]
obtain x where x:"x \<in> E" and orb:"orb = orbit G \<phi> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> E; orb = orbit G \<phi> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
orb \<in> orbits G E \<phi>

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> E; orb = orbit G \<phi> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding orbits_def
[PROOF STATE]
proof (prove)
using this:
orb \<in> {orbit G \<phi> x |x. x \<in> E}

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> E; orb = orbit G \<phi> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> E
orb = orbit G \<phi> x

goal (1 subgoal):
 1. (\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = order G
[PROOF STEP]
have "\<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
assume "y \<in> orb"
[PROOF STATE]
proof (state)
this:
y \<in> orb

goal (1 subgoal):
 1. \<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
hence y: "y \<in> E \<and> y \<in> orbit G \<phi> x"
[PROOF STATE]
proof (prove)
using this:
y \<in> orb

goal (1 subgoal):
 1. y \<in> E \<and> y \<in> orbit G \<phi> x
[PROOF STEP]
using x orb assms(2) orbits_coverture
[PROOF STATE]
proof (prove)
using this:
y \<in> orb
x \<in> E
orb = orbit G \<phi> x
orb \<in> orbits G E \<phi>
\<Union> (orbits G E \<phi>) = E

goal (1 subgoal):
 1. y \<in> E \<and> y \<in> orbit G \<phi> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> E \<and> y \<in> orbit G \<phi> x

goal (1 subgoal):
 1. \<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
hence same_orbit: "(orbit G \<phi> x) = (orbit G \<phi> y)"
[PROOF STATE]
proof (prove)
using this:
y \<in> E \<and> y \<in> orbit G \<phi> x

goal (1 subgoal):
 1. orbit G \<phi> x = orbit G \<phi> y
[PROOF STEP]
using disjoint_union[of "orbit G \<phi> x" "orbit G \<phi> y"] orbit_refl x
[PROOF STATE]
proof (prove)
using this:
y \<in> E \<and> y \<in> orbit G \<phi> x
\<lbrakk>orbit G \<phi> x \<in> orbits G E \<phi>; orbit G \<phi> y \<in> orbits G E \<phi>\<rbrakk> \<Longrightarrow> orbit G \<phi> x = orbit G \<phi> y \<or> orbit G \<phi> x \<inter> orbit G \<phi> y = {}
?x \<in> E \<Longrightarrow> ?x \<in> orbit G \<phi> ?x
x \<in> E

goal (1 subgoal):
 1. orbit G \<phi> x = orbit G \<phi> y
[PROOF STEP]
unfolding orbits_def
[PROOF STATE]
proof (prove)
using this:
y \<in> E \<and> y \<in> orbit G \<phi> x
\<lbrakk>orbit G \<phi> x \<in> {orbit G \<phi> x |x. x \<in> E}; orbit G \<phi> y \<in> {orbit G \<phi> x |x. x \<in> E}\<rbrakk> \<Longrightarrow> orbit G \<phi> x = orbit G \<phi> y \<or> orbit G \<phi> x \<inter> orbit G \<phi> y = {}
?x \<in> E \<Longrightarrow> ?x \<in> orbit G \<phi> ?x
x \<in> E

goal (1 subgoal):
 1. orbit G \<phi> x = orbit G \<phi> y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
orbit G \<phi> x = orbit G \<phi> y

goal (1 subgoal):
 1. \<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
have "card (orbit G \<phi> x) * card (stabilizer G \<phi> x) =
          card (orbit G \<phi> y) * card (stabilizer G \<phi> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (orbit G \<phi> x) * card (stabilizer G \<phi> x) = card (orbit G \<phi> y) * card (stabilizer G \<phi> y)
[PROOF STEP]
using y assms(1) x orbit_stabilizer_theorem
[PROOF STATE]
proof (prove)
using this:
y \<in> E \<and> y \<in> orbit G \<phi> x
finite (carrier G)
x \<in> E
?x \<in> E \<Longrightarrow> card (orbit G \<phi> ?x) * card (stabilizer G \<phi> ?x) = order G

goal (1 subgoal):
 1. card (orbit G \<phi> x) * card (stabilizer G \<phi> x) = card (orbit G \<phi> y) * card (stabilizer G \<phi> y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (orbit G \<phi> x) * card (stabilizer G \<phi> x) = card (orbit G \<phi> y) * card (stabilizer G \<phi> y)

goal (1 subgoal):
 1. \<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
hence "card (orbit G \<phi> x) * card (stabilizer G \<phi> x) =
           card (orbit G \<phi> x) * card (stabilizer G \<phi> y)"
[PROOF STATE]
proof (prove)
using this:
card (orbit G \<phi> x) * card (stabilizer G \<phi> x) = card (orbit G \<phi> y) * card (stabilizer G \<phi> y)

goal (1 subgoal):
 1. card (orbit G \<phi> x) * card (stabilizer G \<phi> x) = card (orbit G \<phi> x) * card (stabilizer G \<phi> y)
[PROOF STEP]
using same_orbit
[PROOF STATE]
proof (prove)
using this:
card (orbit G \<phi> x) * card (stabilizer G \<phi> x) = card (orbit G \<phi> y) * card (stabilizer G \<phi> y)
orbit G \<phi> x = orbit G \<phi> y

goal (1 subgoal):
 1. card (orbit G \<phi> x) * card (stabilizer G \<phi> x) = card (orbit G \<phi> x) * card (stabilizer G \<phi> y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (orbit G \<phi> x) * card (stabilizer G \<phi> x) = card (orbit G \<phi> x) * card (stabilizer G \<phi> y)

goal (1 subgoal):
 1. \<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (orbit G \<phi> x) * card (stabilizer G \<phi> x) = card (orbit G \<phi> x) * card (stabilizer G \<phi> y)

goal (1 subgoal):
 1. \<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
have "orbit G \<phi> x \<noteq> {} \<and> finite (orbit G \<phi> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orbit G \<phi> x \<noteq> {} \<and> finite (orbit G \<phi> x)
[PROOF STEP]
using y orbit_def[of G \<phi> x] assms(1)
[PROOF STATE]
proof (prove)
using this:
y \<in> E \<and> y \<in> orbit G \<phi> x
orbit G \<phi> x = {\<phi> g x |g. g \<in> carrier G}
finite (carrier G)

goal (1 subgoal):
 1. orbit G \<phi> x \<noteq> {} \<and> finite (orbit G \<phi> x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
orbit G \<phi> x \<noteq> {} \<and> finite (orbit G \<phi> x)

goal (1 subgoal):
 1. \<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
hence "card (orbit G \<phi> x) > 0"
[PROOF STATE]
proof (prove)
using this:
orbit G \<phi> x \<noteq> {} \<and> finite (orbit G \<phi> x)

goal (1 subgoal):
 1. 0 < card (orbit G \<phi> x)
[PROOF STEP]
by (simp add: card_gt_0_iff)
[PROOF STATE]
proof (state)
this:
0 < card (orbit G \<phi> x)

goal (1 subgoal):
 1. \<And>y. y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (orbit G \<phi> x) * card (stabilizer G \<phi> x) = card (orbit G \<phi> x) * card (stabilizer G \<phi> y)
0 < card (orbit G \<phi> x)
[PROOF STEP]
show "card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)"
[PROOF STATE]
proof (prove)
using this:
card (orbit G \<phi> x) * card (stabilizer G \<phi> x) = card (orbit G \<phi> x) * card (stabilizer G \<phi> y)
0 < card (orbit G \<phi> x)

goal (1 subgoal):
 1. card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (stabilizer G \<phi> x) = card (stabilizer G \<phi> y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> ?y)

goal (1 subgoal):
 1. (\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = order G
[PROOF STEP]
hence "(\<Sum>x \<in> orb. card (stabilizer G \<phi> x)) = (\<Sum>y \<in> orb. card (stabilizer G \<phi> x))"
[PROOF STATE]
proof (prove)
using this:
?y \<in> orb \<Longrightarrow> card (stabilizer G \<phi> x) = card (stabilizer G \<phi> ?y)

goal (1 subgoal):
 1. (\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = (\<Sum>y\<in>orb. card (stabilizer G \<phi> x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = (\<Sum>y\<in>orb. card (stabilizer G \<phi> x))

goal (1 subgoal):
 1. (\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = order G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = (\<Sum>y\<in>orb. card (stabilizer G \<phi> x))

goal (1 subgoal):
 1. (\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = order G
[PROOF STEP]
have " ... = card (stabilizer G \<phi> x) * (\<Sum>y \<in> orb. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>orb. card (stabilizer G \<phi> x)) = card (stabilizer G \<phi> x) * (\<Sum>y\<in>orb. 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>orb. card (stabilizer G \<phi> x)) = card (stabilizer G \<phi> x) * (\<Sum>y\<in>orb. 1)

goal (1 subgoal):
 1. (\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = order G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>orb. card (stabilizer G \<phi> x)) = card (stabilizer G \<phi> x) * (\<Sum>y\<in>orb. 1)

goal (1 subgoal):
 1. (\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = order G
[PROOF STEP]
have " ... = card (stabilizer G \<phi> x) * card (orbit G \<phi> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (stabilizer G \<phi> x) * (\<Sum>y\<in>orb. 1) = card (stabilizer G \<phi> x) * card (orbit G \<phi> x)
[PROOF STEP]
using orb
[PROOF STATE]
proof (prove)
using this:
orb = orbit G \<phi> x

goal (1 subgoal):
 1. card (stabilizer G \<phi> x) * (\<Sum>y\<in>orb. 1) = card (stabilizer G \<phi> x) * card (orbit G \<phi> x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (stabilizer G \<phi> x) * (\<Sum>y\<in>orb. 1) = card (stabilizer G \<phi> x) * card (orbit G \<phi> x)

goal (1 subgoal):
 1. (\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = order G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = card (stabilizer G \<phi> x) * card (orbit G \<phi> x)
[PROOF STEP]
show "(\<Sum>x \<in> orb. card (stabilizer G \<phi> x)) = order G"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = card (stabilizer G \<phi> x) * card (orbit G \<phi> x)

goal (1 subgoal):
 1. (\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = order G
[PROOF STEP]
by (metis mult.commute orbit_stabilizer_theorem x)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>orb. card (stabilizer G \<phi> x)) = order G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monic_degree_0: "monic p \<Longrightarrow> (degree p = 0) = (p = 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic p \<Longrightarrow> (degree p = 0) = (p = 1)
[PROOF STEP]
using le_degree poly_eq_iff
[PROOF STATE]
proof (prove)
using this:
coeff ?p ?n \<noteq> (0::?'a) \<Longrightarrow> ?n \<le> degree ?p
(?p = ?q) = (\<forall>n. coeff ?p n = coeff ?q n)

goal (1 subgoal):
 1. monic p \<Longrightarrow> (degree p = 0) = (p = 1)
[PROOF STEP]
by force


[STATEMENT]
lemma binrelchain_trans_Cons_snoc:
  assumes "\<And>x y z. P x y \<Longrightarrow> P y z \<Longrightarrow> P x z"
  shows   "binrelchain P (x#xs@[y]) \<Longrightarrow> P x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. binrelchain P (x # xs @ [y]) \<Longrightarrow> P x y
[PROOF STEP]
proof (induct xs arbitrary: x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. binrelchain P (x # [] @ [y]) \<Longrightarrow> P x y
 2. \<And>a xs x. \<lbrakk>\<And>x. binrelchain P (x # xs @ [y]) \<Longrightarrow> P x y; binrelchain P (x # (a # xs) @ [y])\<rbrakk> \<Longrightarrow> P x y
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
binrelchain P (?x # xs_ @ [y]) \<Longrightarrow> P ?x y
binrelchain P (x # (a_ # xs_) @ [y])

goal (2 subgoals):
 1. \<And>x. binrelchain P (x # [] @ [y]) \<Longrightarrow> P x y
 2. \<And>a xs x. \<lbrakk>\<And>x. binrelchain P (x # xs @ [y]) \<Longrightarrow> P x y; binrelchain P (x # (a # xs) @ [y])\<rbrakk> \<Longrightarrow> P x y
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>P ?x ?y; P ?y ?z\<rbrakk> \<Longrightarrow> P ?x ?z
binrelchain P (?x # xs_ @ [y]) \<Longrightarrow> P ?x y
binrelchain P (x # (a_ # xs_) @ [y])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>P ?x ?y; P ?y ?z\<rbrakk> \<Longrightarrow> P ?x ?z
binrelchain P (?x # xs_ @ [y]) \<Longrightarrow> P ?x y
binrelchain P (x # (a_ # xs_) @ [y])

goal (1 subgoal):
 1. P x y
[PROOF STEP]
using binrelchain_Cons_reduce
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>P ?x ?y; P ?y ?z\<rbrakk> \<Longrightarrow> P ?x ?z
binrelchain P (?x # xs_ @ [y]) \<Longrightarrow> P ?x y
binrelchain P (x # (a_ # xs_) @ [y])
binrelchain ?P (?x # ?xs) \<Longrightarrow> binrelchain ?P ?xs

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

goal (1 subgoal):
 1. \<And>x. binrelchain P (x # [] @ [y]) \<Longrightarrow> P x y
[PROOF STEP]
qed simp


[STATEMENT]
lemma cong_mult_lcancel_nat:
  "[k * a = k * b] (mod m) = [a = b] (mod m)"
  if "coprime k m" for a k m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [k * a = k * b] (mod m) = [a = b] (mod m)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
coprime k m

goal (1 subgoal):
 1. [k * a = k * b] (mod m) = [a = b] (mod m)
[PROOF STEP]
by (simp add: cong_mult_rcancel_nat ac_simps)


[STATEMENT]
lemma SbisL_length[simp]:
assumes "SbisL cl dl"
shows "length cl = length dl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length cl = length dl
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
SbisL cl dl

goal (1 subgoal):
 1. length cl = length dl
[PROOF STEP]
unfolding SbisL_def
[PROOF STATE]
proof (prove)
using this:
length cl = length dl \<and> (\<forall>n<length cl. cl ! n \<approx>s dl ! n)

goal (1 subgoal):
 1. length cl = length dl
[PROOF STEP]
by simp


[STATEMENT]
lemma totalSubset:
  fixes A :: "Variable set" and B :: "Variable set" and valuation :: "Valuation"
  assumes "A \<subseteq> B" and "total valuation B"
  shows "total valuation A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CNF.total valuation A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B
CNF.total valuation B

goal (1 subgoal):
 1. CNF.total valuation A
[PROOF STEP]
by auto


[STATEMENT]
lemma sublist_takeWhile [simp, intro]: "sublist (takeWhile P xs) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sublist (takeWhile P xs) xs
[PROOF STEP]
by (rule prefix_imp_sublist[OF takeWhile_is_prefix])


[STATEMENT]
lemma bounded_abs_range[intro]:
  "bounded (range f :: real set) \<Longrightarrow> bounded (range (\<lambda>x. abs (f x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (range f) \<Longrightarrow> bounded (range (\<lambda>x. \<bar>f x\<bar>))
[PROOF STEP]
by (auto simp: bounded_iff)


[STATEMENT]
lemma coplanar_perm_17:
  assumes "Coplanar A B C D"
  shows "Coplanar C D B A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Coplanar C D B A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Coplanar C D B A
[PROOF STEP]
obtain X where P1: "(Col A B X \<and> Col C D X) \<or> (Col A C X \<and> Col B D X) \<or> (Col A D X \<and> Col B C X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Coplanar_def assms
[PROOF STATE]
proof (prove)
using this:
Coplanar ?A ?B ?C ?D \<equiv> \<exists>X. Col ?A ?B X \<and> Col ?C ?D X \<or> Col ?A ?C X \<and> Col ?B ?D X \<or> Col ?A ?D X \<and> Col ?B ?C X
Coplanar A B C D

goal (1 subgoal):
 1. (\<And>X. Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X

goal (1 subgoal):
 1. Coplanar C D B A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X

goal (1 subgoal):
 1. Coplanar C D B A
[PROOF STEP]
using Coplanar_def col_permutation_4
[PROOF STATE]
proof (prove)
using this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X
Coplanar ?A ?B ?C ?D \<equiv> \<exists>X. Col ?A ?B X \<and> Col ?C ?D X \<or> Col ?A ?C X \<and> Col ?B ?D X \<or> Col ?A ?D X \<and> Col ?B ?C X
Col ?A ?B ?C \<Longrightarrow> Col ?B ?A ?C

goal (1 subgoal):
 1. Coplanar C D B A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Coplanar C D B A

goal:
No subgoals!
[PROOF STEP]
qed