[STATEMENT]
lemma chain_boundary_boundary:
  assumes "singular_chain p X c"
  shows "chain_boundary (p - Suc 0) (chain_boundary p c) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain_boundary (p - Suc 0) (chain_boundary p c) = 0
[PROOF STEP]
proof (cases "p -1 = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p - 1 = 0 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p c) = 0
 2. p - 1 \<noteq> 0 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p c) = 0
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p - 1 \<noteq> 0

goal (2 subgoals):
 1. p - 1 = 0 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p c) = 0
 2. p - 1 \<noteq> 0 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p c) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p - 1 \<noteq> 0
[PROOF STEP]
have "2 \<le> p"
[PROOF STATE]
proof (prove)
using this:
p - 1 \<noteq> 0

goal (1 subgoal):
 1. 2 \<le> p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 \<le> p

goal (2 subgoals):
 1. p - 1 = 0 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p c) = 0
 2. p - 1 \<noteq> 0 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p c) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain_boundary (p - Suc 0) (chain_boundary p c) = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
singular_chain p X c

goal (1 subgoal):
 1. chain_boundary (p - Suc 0) (chain_boundary p c) = 0
[PROOF STEP]
unfolding singular_chain_def
[PROOF STATE]
proof (prove)
using this:
Poly_Mapping.keys c \<subseteq> singular_simplex_set p X

goal (1 subgoal):
 1. chain_boundary (p - Suc 0) (chain_boundary p c) = 0
[PROOF STEP]
proof (induction rule: frag_induction)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. chain_boundary (p - Suc 0) (chain_boundary p 0) = 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of x)) = 0
 3. \<And>a b. \<lbrakk>chain_boundary (p - Suc 0) (chain_boundary p a) = 0; chain_boundary (p - Suc 0) (chain_boundary p b) = 0\<rbrakk> \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (a - b)) = 0
[PROOF STEP]
case (one g)
[PROOF STATE]
proof (state)
this:
g \<in> singular_simplex_set p X

goal (3 subgoals):
 1. chain_boundary (p - Suc 0) (chain_boundary p 0) = 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of x)) = 0
 3. \<And>a b. \<lbrakk>chain_boundary (p - Suc 0) (chain_boundary p a) = 0; chain_boundary (p - Suc 0) (chain_boundary p b) = 0\<rbrakk> \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (a - b)) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g \<in> singular_simplex_set p X
[PROOF STEP]
have ss: "singular_simplex p X g"
[PROOF STATE]
proof (prove)
using this:
g \<in> singular_simplex_set p X

goal (1 subgoal):
 1. singular_simplex p X g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
singular_simplex p X g

goal (3 subgoals):
 1. chain_boundary (p - Suc 0) (chain_boundary p 0) = 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of x)) = 0
 3. \<And>a b. \<lbrakk>chain_boundary (p - Suc 0) (chain_boundary p a) = 0; chain_boundary (p - Suc 0) (chain_boundary p b) = 0\<rbrakk> \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (a - b)) = 0
[PROOF STEP]
have eql: "{..p} \<times> {..p - Suc 0} \<inter> {(x, y). y < x} = (\<lambda>(j,i). (Suc i, j)) ` {(i,j). i \<le> j \<and> j \<le> p -1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..p} \<times> {..p - Suc 0} \<inter> {(x, y). y < x} = (\<lambda>(j, i). (Suc i, j)) ` {(i, j). i \<le> j \<and> j \<le> p - 1}
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
p - 1 \<noteq> 0

goal (1 subgoal):
 1. {..p} \<times> {..p - Suc 0} \<inter> {(x, y). y < x} = (\<lambda>(j, i). (Suc i, j)) ` {(i, j). i \<le> j \<and> j \<le> p - 1}
[PROOF STEP]
by (auto simp: image_def) (metis One_nat_def diff_Suc_1 diff_le_mono le_refl lessE less_imp_le_nat)
[PROOF STATE]
proof (state)
this:
{..p} \<times> {..p - Suc 0} \<inter> {(x, y). y < x} = (\<lambda>(j, i). (Suc i, j)) ` {(i, j). i \<le> j \<and> j \<le> p - 1}

goal (3 subgoals):
 1. chain_boundary (p - Suc 0) (chain_boundary p 0) = 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of x)) = 0
 3. \<And>a b. \<lbrakk>chain_boundary (p - Suc 0) (chain_boundary p a) = 0; chain_boundary (p - Suc 0) (chain_boundary p b) = 0\<rbrakk> \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (a - b)) = 0
[PROOF STEP]
have eqr: "{..p} \<times> {..p - Suc 0} - {(x, y). y < x} = {(i,j). i \<le> j \<and> j \<le> p -1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..p} \<times> {..p - Suc 0} - {(x, y). y < x} = {(i, j). i \<le> j \<and> j \<le> p - 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{..p} \<times> {..p - Suc 0} - {(x, y). y < x} = {(i, j). i \<le> j \<and> j \<le> p - 1}

goal (3 subgoals):
 1. chain_boundary (p - Suc 0) (chain_boundary p 0) = 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of x)) = 0
 3. \<And>a b. \<lbrakk>chain_boundary (p - Suc 0) (chain_boundary p a) = 0; chain_boundary (p - Suc 0) (chain_boundary p b) = 0\<rbrakk> \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (a - b)) = 0
[PROOF STEP]
have eqf: "singular_face (p - Suc 0) i (singular_face p (Suc j) g) =
               singular_face (p - Suc 0) j (singular_face p i g)" if "i \<le> j" "j \<le> p - Suc 0" for i j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_face (p - Suc 0) i (singular_face p (Suc j) g) = singular_face (p - Suc 0) j (singular_face p i g)
[PROOF STEP]
proof (rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. singular_face (p - Suc 0) i (singular_face p (Suc j) g) x = singular_face (p - Suc 0) j (singular_face p i g) x
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. singular_face (p - Suc 0) i (singular_face p (Suc j) g) x = singular_face (p - Suc 0) j (singular_face p i g) x
[PROOF STEP]
show "singular_face (p - Suc 0) i (singular_face p (Suc j) g) t =
            singular_face (p - Suc 0) j (singular_face p i g) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
[PROOF STEP]
proof (cases "t \<in> standard_simplex (p -1 -1)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t \<in> standard_simplex (p - 1 - 1) \<Longrightarrow> singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
 2. t \<notin> standard_simplex (p - 1 - 1) \<Longrightarrow> singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
t \<in> standard_simplex (p - 1 - 1)

goal (2 subgoals):
 1. t \<in> standard_simplex (p - 1 - 1) \<Longrightarrow> singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
 2. t \<notin> standard_simplex (p - 1 - 1) \<Longrightarrow> singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
[PROOF STEP]
have fi: "simplical_face i t \<in> standard_simplex (p - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplical_face i t \<in> standard_simplex (p - Suc 0)
[PROOF STEP]
using False True simplical_face_in_standard_simplex that
[PROOF STATE]
proof (prove)
using this:
p - 1 \<noteq> 0
t \<in> standard_simplex (p - 1 - 1)
\<lbrakk>1 \<le> ?p; ?k \<le> ?p; ?x \<in> standard_simplex (?p - Suc 0)\<rbrakk> \<Longrightarrow> simplical_face ?k ?x \<in> standard_simplex ?p
i \<le> j
j \<le> p - Suc 0

goal (1 subgoal):
 1. simplical_face i t \<in> standard_simplex (p - Suc 0)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
simplical_face i t \<in> standard_simplex (p - Suc 0)

goal (2 subgoals):
 1. t \<in> standard_simplex (p - 1 - 1) \<Longrightarrow> singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
 2. t \<notin> standard_simplex (p - 1 - 1) \<Longrightarrow> singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
[PROOF STEP]
have fj: "simplical_face j t \<in> standard_simplex (p - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplical_face j t \<in> standard_simplex (p - Suc 0)
[PROOF STEP]
by (metis False One_nat_def True simplical_face_in_standard_simplex less_one not_less that(2))
[PROOF STATE]
proof (state)
this:
simplical_face j t \<in> standard_simplex (p - Suc 0)

goal (2 subgoals):
 1. t \<in> standard_simplex (p - 1 - 1) \<Longrightarrow> singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
 2. t \<notin> standard_simplex (p - 1 - 1) \<Longrightarrow> singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
[PROOF STEP]
have eq: "simplical_face (Suc j) (simplical_face i t) = simplical_face i (simplical_face j t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplical_face (Suc j) (simplical_face i t) = simplical_face i (simplical_face j t)
[PROOF STEP]
using True that ss
[PROOF STATE]
proof (prove)
using this:
t \<in> standard_simplex (p - 1 - 1)
i \<le> j
j \<le> p - Suc 0
singular_simplex p X g

goal (1 subgoal):
 1. simplical_face (Suc j) (simplical_face i t) = simplical_face i (simplical_face j t)
[PROOF STEP]
unfolding standard_simplex_def simplical_face_def
[PROOF STATE]
proof (prove)
using this:
t \<in> {x. (\<forall>i. 0 \<le> x i \<and> x i \<le> 1) \<and> (\<forall>i>p - 1 - 1. x i = 0) \<and> sum x {..p - 1 - 1} = 1}
i \<le> j
j \<le> p - Suc 0
singular_simplex p X g

goal (1 subgoal):
 1. (\<lambda>ia. if ia < Suc j then if ia < i then t ia else if ia = i then 0 else t (ia - 1) else if ia = Suc j then 0 else if ia - 1 < i then t (ia - 1) else if ia - 1 = i then 0 else t (ia - 1 - 1)) = (\<lambda>ia. if ia < i then if ia < j then t ia else if ia = j then 0 else t (ia - 1) else if ia = i then 0 else if ia - 1 < j then t (ia - 1) else if ia - 1 = j then 0 else t (ia - 1 - 1))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
simplical_face (Suc j) (simplical_face i t) = simplical_face i (simplical_face j t)

goal (2 subgoals):
 1. t \<in> standard_simplex (p - 1 - 1) \<Longrightarrow> singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
 2. t \<notin> standard_simplex (p - 1 - 1) \<Longrightarrow> singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
[PROOF STEP]
by (simp add: singular_face_def fi fj eq)
[PROOF STATE]
proof (state)
this:
singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t

goal (1 subgoal):
 1. t \<notin> standard_simplex (p - 1 - 1) \<Longrightarrow> singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t
[PROOF STEP]
qed (simp add: singular_face_def)
[PROOF STATE]
proof (state)
this:
singular_face (p - Suc 0) i (singular_face p (Suc j) g) t = singular_face (p - Suc 0) j (singular_face p i g) t

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i \<le> ?j; ?j \<le> p - Suc 0\<rbrakk> \<Longrightarrow> singular_face (p - Suc 0) ?i (singular_face p (Suc ?j) g) = singular_face (p - Suc 0) ?j (singular_face p ?i g)

goal (3 subgoals):
 1. chain_boundary (p - Suc 0) (chain_boundary p 0) = 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of x)) = 0
 3. \<And>a b. \<lbrakk>chain_boundary (p - Suc 0) (chain_boundary p a) = 0; chain_boundary (p - Suc 0) (chain_boundary p b) = 0\<rbrakk> \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (a - b)) = 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
[PROOF STEP]
proof (cases "p = 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 1 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
 2. p \<noteq> 1 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 1

goal (2 subgoals):
 1. p = 1 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
 2. p \<noteq> 1 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
[PROOF STEP]
have eq0: "frag_cmul (-1) a = b \<Longrightarrow> a + b = 0" for a b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frag_cmul (- 1) a = b \<Longrightarrow> a + b = 0
[PROOF STEP]
by (simp add: neg_eq_iff_add_eq_0)
[PROOF STATE]
proof (state)
this:
frag_cmul (- 1) ?a1 = ?b1 \<Longrightarrow> ?a1 + ?b1 = 0

goal (2 subgoals):
 1. p = 1 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
 2. p \<noteq> 1 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
[PROOF STEP]
have *: "(\<Sum>x\<le>p. \<Sum>i\<le>p - Suc 0.
                 frag_cmul ((-1) ^ (x + i)) (frag_of (singular_face (p - Suc 0) i (singular_face p x g))))
              = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<le>p. \<Sum>i\<le>p - Suc 0. frag_cmul ((- 1) ^ (x + i)) (frag_of (singular_face (p - Suc 0) i (singular_face p x g)))) = 0
[PROOF STEP]
apply (simp add: sum.cartesian_product sum.Int_Diff [of "_ \<times> _" _ "{(x,y). y < x}"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{..p} \<times> {..p - Suc 0} \<inter> {(x, y). y < x}. case x of (x, i) \<Rightarrow> frag_cmul ((- 1) ^ (x + i)) (frag_of (singular_face (p - Suc 0) i (singular_face p x g)))) + (\<Sum>x\<in>{..p} \<times> {..p - Suc 0} - {(x, y). y < x}. case x of (x, i) \<Rightarrow> frag_cmul ((- 1) ^ (x + i)) (frag_of (singular_face (p - Suc 0) i (singular_face p x g)))) = 0
[PROOF STEP]
apply (rule eq0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frag_cmul (- 1) (\<Sum>x\<in>{..p} \<times> {..p - Suc 0} \<inter> {(x, y). y < x}. case x of (x, i) \<Rightarrow> frag_cmul ((- 1) ^ (x + i)) (frag_of (singular_face (p - Suc 0) i (singular_face p x g)))) = (\<Sum>x\<in>{..p} \<times> {..p - Suc 0} - {(x, y). y < x}. case x of (x, i) \<Rightarrow> frag_cmul ((- 1) ^ (x + i)) (frag_of (singular_face (p - Suc 0) i (singular_face p x g))))
[PROOF STEP]
unfolding frag_cmul_sum prod.case_distrib [of "frag_cmul (-1)"] frag_cmul_cmul eql eqr
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>(\<lambda>(j, i). (Suc i, j)) ` {(i, j). i \<le> j \<and> j \<le> p - 1}. case i of (x1, x2) \<Rightarrow> frag_cmul (- 1 * (- 1) ^ (x1 + x2)) (frag_of (singular_face (p - Suc 0) x2 (singular_face p x1 g)))) = (\<Sum>x\<in>{(i, j). i \<le> j \<and> j \<le> p - 1}. case x of (x, i) \<Rightarrow> frag_cmul ((- 1) ^ (x + i)) (frag_of (singular_face (p - Suc 0) i (singular_face p x g))))
[PROOF STEP]
apply (force simp: inj_on_def sum.reindex add.commute eqf intro: sum.cong)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<le>p. \<Sum>i\<le>p - Suc 0. frag_cmul ((- 1) ^ (x + i)) (frag_of (singular_face (p - Suc 0) i (singular_face p x g)))) = 0

goal (2 subgoals):
 1. p = 1 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
 2. p \<noteq> 1 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 1

goal (1 subgoal):
 1. chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
[PROOF STEP]
by (simp add: chain_boundary_of chain_boundary_sum chain_boundary_cmul frag_cmul_sum * flip: power_add)
[PROOF STATE]
proof (state)
this:
chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0

goal (1 subgoal):
 1. p = 1 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0
[PROOF STEP]
qed (simp add: chain_boundary_def)
[PROOF STATE]
proof (state)
this:
chain_boundary (p - Suc 0) (chain_boundary p (frag_of g)) = 0

goal (2 subgoals):
 1. chain_boundary (p - Suc 0) (chain_boundary p 0) = 0
 2. \<And>a b. \<lbrakk>chain_boundary (p - Suc 0) (chain_boundary p a) = 0; chain_boundary (p - Suc 0) (chain_boundary p b) = 0\<rbrakk> \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (a - b)) = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. chain_boundary (p - Suc 0) (chain_boundary p 0) = 0
 2. \<And>a b. \<lbrakk>chain_boundary (p - Suc 0) (chain_boundary p a) = 0; chain_boundary (p - Suc 0) (chain_boundary p b) = 0\<rbrakk> \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (a - b)) = 0
[PROOF STEP]
case (diff a b)
[PROOF STATE]
proof (state)
this:
chain_boundary (p - Suc 0) (chain_boundary p a) = 0
chain_boundary (p - Suc 0) (chain_boundary p b) = 0

goal (2 subgoals):
 1. chain_boundary (p - Suc 0) (chain_boundary p 0) = 0
 2. \<And>a b. \<lbrakk>chain_boundary (p - Suc 0) (chain_boundary p a) = 0; chain_boundary (p - Suc 0) (chain_boundary p b) = 0\<rbrakk> \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p (a - b)) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
chain_boundary (p - Suc 0) (chain_boundary p a) = 0
chain_boundary (p - Suc 0) (chain_boundary p b) = 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
chain_boundary (p - Suc 0) (chain_boundary p a) = 0
chain_boundary (p - Suc 0) (chain_boundary p b) = 0

goal (1 subgoal):
 1. chain_boundary (p - Suc 0) (chain_boundary p (a - b)) = 0
[PROOF STEP]
by (simp add: chain_boundary_diff)
[PROOF STATE]
proof (state)
this:
chain_boundary (p - Suc 0) (chain_boundary p (a - b)) = 0

goal (1 subgoal):
 1. chain_boundary (p - Suc 0) (chain_boundary p 0) = 0
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
chain_boundary (p - Suc 0) (chain_boundary p c) = 0

goal (1 subgoal):
 1. p - 1 = 0 \<Longrightarrow> chain_boundary (p - Suc 0) (chain_boundary p c) = 0
[PROOF STEP]
qed (simp add: chain_boundary_def)


[STATEMENT]
lemma ucast_less_shiftl_helper:
  "\<lbrakk> LENGTH('b) + 2 < LENGTH('a); 2 ^ (LENGTH('b) + 2) \<le> n\<rbrakk>
    \<Longrightarrow> (ucast (x :: 'b::len word) << 2) < (n :: 'a::len word)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>LENGTH('b) + 2 < LENGTH('a); 2 ^ (LENGTH('b) + 2) \<le> n\<rbrakk> \<Longrightarrow> UCAST('b \<rightarrow> 'a) x << 2 < n
[PROOF STEP]
apply (erule order_less_le_trans[rotated])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LENGTH('b) + 2 < LENGTH('a) \<Longrightarrow> UCAST('b \<rightarrow> 'a) x << 2 < 2 ^ (LENGTH('b) + 2)
[PROOF STEP]
using ucast_less[where x=x and 'a='a]
[PROOF STATE]
proof (prove)
using this:
LENGTH('b) < LENGTH('a) \<Longrightarrow> UCAST('b \<rightarrow> 'a) x < 2 ^ LENGTH('b)

goal (1 subgoal):
 1. LENGTH('b) + 2 < LENGTH('a) \<Longrightarrow> UCAST('b \<rightarrow> 'a) x << 2 < 2 ^ (LENGTH('b) + 2)
[PROOF STEP]
apply (simp only: shiftl_t2n field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>LENGTH('b) + 2 < LENGTH('a); LENGTH('b) < LENGTH('a) \<Longrightarrow> UCAST('b \<rightarrow> 'a) x < 2 ^ LENGTH('b)\<rbrakk> \<Longrightarrow> UCAST('b \<rightarrow> 'a) x * 2\<^sup>2 < 2 ^ (LENGTH('b) + 2)
[PROOF STEP]
apply (rule word_less_power_trans2; simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma simplify_preserves_semantic :
  assumes "T = simplify S"
  assumes "all_fulfill finite S"
  shows "validate_formula I S \<longleftrightarrow> validate_formula I T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<Turnstile> S = I \<Turnstile> T
[PROOF STEP]
by (metis (mono_tags, lifting) assms mem_Collect_eq redundancy_and_semantics simplify_and_membership
    simplify_def validate_formula.simps)


[STATEMENT]
lemma sort_remdups: "sort (remdups xs) = remdups (sort xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sort (remdups xs) = remdups (sort xs)
[PROOF STEP]
by(rule sorted_distinct_set_unique) simp_all


[STATEMENT]
lemma powhr: "(star_n X) powhr (star_n Y) = star_n (\<lambda>n. (X n) powr (Y n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. star_n X powhr star_n Y = star_n (\<lambda>n. X n powr Y n)
[PROOF STEP]
by (simp add: powhr_def starfun2_star_n)


[STATEMENT]
lemma between_mem_segment: "between (a,b) x \<longleftrightarrow> x \<in> closed_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. between (a, b) x = (x \<in> closed_segment a b)
[PROOF STEP]
unfolding between_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case (a, b) of (a, b) \<Rightarrow> \<lambda>x. x \<in> closed_segment a b) x = (x \<in> closed_segment a b)
[PROOF STEP]
by auto


[STATEMENT]
lemma usum_mono: "[| A<=A';  B<=B' |] ==> usum A B <= usum A' B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> A'; B \<subseteq> B'\<rbrakk> \<Longrightarrow> usum A B \<subseteq> usum A' B'
[PROOF STEP]
by (simp add: usum_def, blast)


[STATEMENT]
lemma vec_to_iarray_plus[code_unfold]: "vec_to_iarray (a + b) =  (vec_to_iarray a) + (vec_to_iarray b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray (a + b) = vec_to_iarray a + vec_to_iarray b
[PROOF STEP]
unfolding vec_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.of_fun (\<lambda>i. (a + b) $ mod_type_class.from_nat i) CARD('b) = IArray.of_fun (\<lambda>i. a $ mod_type_class.from_nat i) CARD('b) + IArray.of_fun (\<lambda>i. b $ mod_type_class.from_nat i) CARD('b)
[PROOF STEP]
unfolding plus_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.of_fun (\<lambda>i. (a + b) $ mod_type_class.from_nat i) CARD('b) = IArray.of_fun (\<lambda>n. IArray.of_fun (\<lambda>i. a $ mod_type_class.from_nat i) CARD('b) !! n + IArray.of_fun (\<lambda>i. b $ mod_type_class.from_nat i) CARD('b) !! n) (IArray.length (IArray.of_fun (\<lambda>i. a $ mod_type_class.from_nat i) CARD('b)))
[PROOF STEP]
by auto


[STATEMENT]
lemma cf_cn_comp_ArrMap_app[cat_cn_cs_simps]:
  assumes "\<GG> : \<BB> \<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<BB>" and "a \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>"
  shows "(\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
interpret L: is_functor \<alpha> \<open>op_cat \<BB>\<close> \<CC> \<GG>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> : op_cat \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
interpret R: is_functor \<alpha> \<open>op_cat \<AA>\<close> \<BB> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : op_cat \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
by
      (
        rule smcf_cn_comp_ArrMap_app
          [
            OF
              L.cf_is_semifunctor[unfolded slicing_commute[symmetric]]
              R.cf_is_semifunctor[unfolded slicing_commute[symmetric]],
            unfolded slicing_commute slicing_simps,
            OF assms(3)
          ]
      )
[PROOF STATE]
proof (state)
this:
(\<GG> \<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ArrMap\<rparr>\<lparr>\<FF>\<lparr>ArrMap\<rparr>\<lparr>a\<rparr>\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isolate_islimpt_iff:"(x isolate S) \<longleftrightarrow> (\<not> (x islimpt S) \<and> x\<in>S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x isolate S = (\<not> x islimpt S \<and> x \<in> S)
[PROOF STEP]
unfolding isolate_def islimpt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> S \<and> (\<exists>T. open T \<and> T \<inter> S = {x})) = (\<not> (\<forall>T. x \<in> T \<longrightarrow> open T \<longrightarrow> (\<exists>y\<in>S. y \<in> T \<and> y \<noteq> x)) \<and> x \<in> S)
[PROOF STEP]
by auto


[STATEMENT]
lemma smaller_interp_trans:
  assumes "smaller_interp a b"
      and "smaller_interp b c"
    shows "smaller_interp a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smaller_interp a c
[PROOF STEP]
by (metis assms(1) assms(2) dual_order.trans smaller_interp_def)


[STATEMENT]
lemma is_lub_exec_lub:
  "\<lbrakk> single_valued r; acyclic r; (x,u):r^*; (y,u):r^*; \<forall>x y. (x,y) \<in> r \<longrightarrow> f x = y \<rbrakk>
  \<Longrightarrow> is_lub (r^* ) x y (exec_lub r f x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued r; acyclic r; (x, u) \<in> r\<^sup>*; (y, u) \<in> r\<^sup>*; \<forall>x y. (x, y) \<in> r \<longrightarrow> f x = y\<rbrakk> \<Longrightarrow> is_lub (r\<^sup>*) x y (exec_lub r f x y)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued r; acyclic r; (x, u) \<in> r\<^sup>*; (y, u) \<in> r\<^sup>*; \<forall>x y. (x, y) \<in> r \<longrightarrow> f x = y\<rbrakk> \<Longrightarrow> is_lub (r\<^sup>*) x y (exec_lub r f x y)
[PROOF STEP]
by (fastforce dest: single_valued_has_lubs simp add: exec_lub_conv)


[STATEMENT]
lemma pmf_expectation_eq_infsetsum: "measure_pmf.expectation p f = infsetsum (\<lambda>x. pmf p x * f x) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation p f = (\<Sum>\<^sub>ax. pmf p x * f x)
[PROOF STEP]
unfolding infsetsum_def measure_pmf_eq_density
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (density (count_space UNIV) (\<lambda>x. ennreal (pmf p x))) f = LINT x|count_space UNIV. pmf p x * f x
[PROOF STEP]
by (subst integral_density) simp_all


[STATEMENT]
lemma continuous_map_into_subtopology:
   "\<lbrakk>continuous_map X X' f; f ` topspace X \<subseteq> T\<rbrakk> \<Longrightarrow> continuous_map X (subtopology X' T) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X X' f; f ` topspace X \<subseteq> T\<rbrakk> \<Longrightarrow> continuous_map X (subtopology X' T) f
[PROOF STEP]
by (auto simp: continuous_map_in_subtopology)


[STATEMENT]
lemma finite_lookup_nat [simp]:
  fixes f :: "'a \<Rightarrow>\<^sub>0 nat"
  shows "finite {k. 0 < lookup f k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {k. 0 < lookup f k}
[PROOF STEP]
using poly_mapping.lookup [of f]
[PROOF STATE]
proof (prove)
using this:
lookup f \<in> {f. finite {x. f x \<noteq> 0}}

goal (1 subgoal):
 1. finite {k. 0 < lookup f k}
[PROOF STEP]
by simp


[STATEMENT]
lemma X_plus_closed:
  assumes "a \<in> carrier R"
  shows "(X_plus a) \<in> carrier P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X_poly_plus R a \<in> carrier P
[PROOF STEP]
unfolding X_poly_plus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X_poly R \<oplus>\<^bsub>UP R\<^esub> to_polynomial R a \<in> carrier P
[PROOF STEP]
using X_closed to_poly_closed
[PROOF STATE]
proof (prove)
using this:
X_poly R \<in> carrier P
?a \<in> carrier R \<Longrightarrow> to_polynomial R ?a \<in> carrier P

goal (1 subgoal):
 1. X_poly R \<oplus>\<^bsub>UP R\<^esub> to_polynomial R a \<in> carrier P
[PROOF STEP]
using P_def UP_a_closed assms
[PROOF STATE]
proof (prove)
using this:
X_poly R \<in> carrier P
?a \<in> carrier R \<Longrightarrow> to_polynomial R ?a \<in> carrier P
P \<equiv> UP R
\<lbrakk>?p \<in> carrier P; ?q \<in> carrier P\<rbrakk> \<Longrightarrow> ?p \<oplus>\<^bsub>P\<^esub> ?q \<in> carrier P
a \<in> carrier R

goal (1 subgoal):
 1. X_poly R \<oplus>\<^bsub>UP R\<^esub> to_polynomial R a \<in> carrier P
[PROOF STEP]
by auto


[STATEMENT]
lemma Nmul_commute: "isnormNum x \<Longrightarrow> isnormNum y \<Longrightarrow> x *\<^sub>N y = y *\<^sub>N x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isnormNum x; isnormNum y\<rbrakk> \<Longrightarrow> x *\<^sub>N y = y *\<^sub>N x
[PROOF STEP]
by (simp add: Nmul_def split_def Let_def gcd.commute mult.commute)


[STATEMENT]
lemma length_substs[simp]: "length xs = length ys \<Longrightarrow> length (substs_src z xs ys Q) = length (substs_dst z xs ys Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> length (substs_src z xs ys Q) = length (substs_dst z xs ys Q)
[PROOF STEP]
by (induct xs ys arbitrary: z Q rule: list_induct2) auto


[STATEMENT]
lemma subset_empty_fset:
  shows "xs |\<subseteq>| {||} \<longleftrightarrow> xs = {||}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs |\<subseteq>| {||}) = (xs = {||})
[PROOF STEP]
by (descending) (simp)


[STATEMENT]
lemma ne_imp_pos: "nat_to_set u \<noteq> {} \<Longrightarrow> u > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_set u \<noteq> {} \<Longrightarrow> 0 < u
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>nat_to_set u \<noteq> {}; \<not> 0 < u\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume A1: "nat_to_set u \<noteq> {}"
[PROOF STATE]
proof (state)
this:
nat_to_set u \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>nat_to_set u \<noteq> {}; \<not> 0 < u\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "\<not> 0 < u"
[PROOF STATE]
proof (state)
this:
\<not> 0 < u

goal (1 subgoal):
 1. \<lbrakk>nat_to_set u \<noteq> {}; \<not> 0 < u\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 < u
[PROOF STEP]
have "u = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < u

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

goal (1 subgoal):
 1. \<lbrakk>nat_to_set u \<noteq> {}; \<not> 0 < u\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u = 0
[PROOF STEP]
have "nat_to_set u = {}"
[PROOF STATE]
proof (prove)
using this:
u = 0

goal (1 subgoal):
 1. nat_to_set u = {}
[PROOF STEP]
by (simp add: zero_is_empty)
[PROOF STATE]
proof (state)
this:
nat_to_set u = {}

goal (1 subgoal):
 1. \<lbrakk>nat_to_set u \<noteq> {}; \<not> 0 < u\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with A1
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u \<noteq> {}
nat_to_set u = {}
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
nat_to_set u \<noteq> {}
nat_to_set u = {}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prim_comm_short_emp: assumes "primitive p" and "u\<cdot>p=p\<cdot>u" and "\<^bold>|u\<^bold>| < \<^bold>|p\<^bold>|"
  shows "u = \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u = \<epsilon>
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u \<noteq> \<epsilon> \<Longrightarrow> False
[PROOF STEP]
assume "u \<noteq> \<epsilon>"
[PROOF STATE]
proof (state)
this:
u \<noteq> \<epsilon>

goal (1 subgoal):
 1. u \<noteq> \<epsilon> \<Longrightarrow> False
[PROOF STEP]
from \<open>u \<cdot> p = p \<cdot> u\<close>
[PROOF STATE]
proof (chain)
picking this:
u \<cdot> p = p \<cdot> u
[PROOF STEP]
have "\<rho> u = \<rho> p"
[PROOF STATE]
proof (prove)
using this:
u \<cdot> p = p \<cdot> u

goal (1 subgoal):
 1. \<rho> u = \<rho> p
[PROOF STEP]
unfolding comm_primroots[OF \<open>u \<noteq> \<epsilon>\<close> prim_nemp, OF \<open>primitive p\<close>]
[PROOF STATE]
proof (prove)
using this:
\<rho> u = \<rho> p

goal (1 subgoal):
 1. \<rho> u = \<rho> p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<rho> u = \<rho> p

goal (1 subgoal):
 1. u \<noteq> \<epsilon> \<Longrightarrow> False
[PROOF STEP]
have "\<rho> u = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<rho> u = p
[PROOF STEP]
using prim_self_root[OF \<open>primitive p\<close>, folded \<open>\<rho> u = \<rho> p\<close>]
[PROOF STATE]
proof (prove)
using this:
\<rho> u = p

goal (1 subgoal):
 1. \<rho> u = p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<rho> u = p

goal (1 subgoal):
 1. u \<noteq> \<epsilon> \<Longrightarrow> False
[PROOF STEP]
from \<open>\<^bold>|u\<^bold>| < \<^bold>|p\<^bold>|\<close>[folded this]
[PROOF STATE]
proof (chain)
picking this:
\<^bold>|u\<^bold>| < \<^bold>|\<rho> u\<^bold>|
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<^bold>|u\<^bold>| < \<^bold>|\<rho> u\<^bold>|

goal (1 subgoal):
 1. False
[PROOF STEP]
using primroot_len_le[OF \<open>u \<noteq> \<epsilon>\<close>]
[PROOF STATE]
proof (prove)
using this:
\<^bold>|u\<^bold>| < \<^bold>|\<rho> u\<^bold>|
\<^bold>|\<rho> u\<^bold>| \<le> \<^bold>|u\<^bold>|

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_gr0_imp_finite: "0 < card A \<Longrightarrow> finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < card A \<Longrightarrow> finite A
[PROOF STEP]
by (rule ccontr, simp)


[STATEMENT]
lemma monic_power:
  assumes "monic (p :: 'a :: idom poly)"
  shows "monic (p ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (p ^ n)
[PROOF STEP]
by (induct n, insert assms, auto intro: monic_mult)


[STATEMENT]
lemma word_of_nat_inj:
  assumes bounded: "x < 2 ^ LENGTH('a)" "y < 2 ^ LENGTH('a)"
  assumes of_nats: "of_nat x = (of_nat y :: 'a::len word)"
  shows "x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (rule contrapos_pp[OF of_nats]; cases "x < y"; cases "y < x")
     (auto dest: bounded[THEN of_nat_mono_maybe])


[STATEMENT]
lemma ereal_tendsto_simps1:
  "((f \<circ> real_of_ereal) \<longlongrightarrow> y) (at_left (ereal x)) \<longleftrightarrow> (f \<longlongrightarrow> y) (at_left x)"
  "((f \<circ> real_of_ereal) \<longlongrightarrow> y) (at_right (ereal x)) \<longleftrightarrow> (f \<longlongrightarrow> y) (at_right x)"
  "((f \<circ> real_of_ereal) \<longlongrightarrow> y) (at_left (\<infinity>::ereal)) \<longleftrightarrow> (f \<longlongrightarrow> y) at_top"
  "((f \<circ> real_of_ereal) \<longlongrightarrow> y) (at_right (-\<infinity>::ereal)) \<longleftrightarrow> (f \<longlongrightarrow> y) at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((f \<circ> real_of_ereal) \<longlongrightarrow> y) (at_left (ereal x)) = (f \<longlongrightarrow> y) (at_left x) &&& ((f \<circ> real_of_ereal) \<longlongrightarrow> y) (at_right (ereal x)) = (f \<longlongrightarrow> y) (at_right x)) &&& ((f \<circ> real_of_ereal) \<longlongrightarrow> y) (at_left \<infinity>) = (f \<longlongrightarrow> y) at_top &&& ((f \<circ> real_of_ereal) \<longlongrightarrow> y) (at_right (- \<infinity>)) = (f \<longlongrightarrow> y) at_bot
[PROOF STEP]
unfolding tendsto_compose_filtermap at_left_ereal at_right_ereal at_left_PInf at_right_MInf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((f \<longlongrightarrow> y) (filtermap real_of_ereal (filtermap ereal (at_left x))) = (f \<longlongrightarrow> y) (at_left x) &&& (f \<longlongrightarrow> y) (filtermap real_of_ereal (filtermap ereal (at_right x))) = (f \<longlongrightarrow> y) (at_right x)) &&& (f \<longlongrightarrow> y) (filtermap real_of_ereal (filtermap ereal at_top)) = (f \<longlongrightarrow> y) at_top &&& (f \<longlongrightarrow> y) (filtermap real_of_ereal (filtermap ereal at_bot)) = (f \<longlongrightarrow> y) at_bot
[PROOF STEP]
by (auto simp: filtermap_filtermap filtermap_ident)


[STATEMENT]
lemma wens_subset: "wens F act B - B \<subseteq> wp act B \<inter> awp F (B \<union> wens F act B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wens F act B - B \<subseteq> wp act B \<inter> awp F (B \<union> wens F act B)
[PROOF STEP]
by (subst wens_unfold, fast)


[STATEMENT]
theorem While_BisT[simp]:
assumes "compatTst tst" and "c \<approx>T d"
shows "While tst c \<approx>T While tst d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. while tst do c \<approx>T while tst do d
[PROOF STEP]
using assms thetaWhileW0_BisT
[PROOF STATE]
proof (prove)
using this:
compatTst tst
c \<approx>T d
thetaWhileW0 \<subseteq> BisT

goal (1 subgoal):
 1. while tst do c \<approx>T while tst do d
[PROOF STEP]
unfolding thetaWhileW0_def
[PROOF STATE]
proof (prove)
using this:
compatTst tst
c \<approx>T d
{(while tst do c, while tst do d) |tst c d. compatTst tst \<and> c \<approx>T d} \<union> {(c1 ;; while tst do c, d1 ;; while tst do d) |tst c1 d1 c d. compatTst tst \<and> c1 \<approx>T d1 \<and> c \<approx>T d} \<subseteq> BisT

goal (1 subgoal):
 1. while tst do c \<approx>T while tst do d
[PROOF STEP]
by auto


[STATEMENT]
lemma T_splay_simps[simp]:
  "T_splay a (Node l a r) = 1"
  "x<b \<Longrightarrow> T_splay x (Node Leaf b CD) = 1"
  "a<b \<Longrightarrow> T_splay a (Node (Node A a B) b CD) = 1"
  "x<a \<Longrightarrow> x<b \<Longrightarrow> T_splay x (Node (Node A a B) b CD) =
   (if A = Leaf then 1 else T_splay x A + 1)"
  "x<b \<Longrightarrow> a<x \<Longrightarrow> T_splay x (Node (Node A a B) b CD) =
   (if B = Leaf then 1 else T_splay x B + 1)"
  "b<x \<Longrightarrow> T_splay x (Node AB b Leaf) = 1"
  "b<a \<Longrightarrow> T_splay a (Node AB b (Node C a D)) = 1"
  "b<x \<Longrightarrow> x<c \<Longrightarrow> T_splay x (Node AB b (Node C c D)) =
  (if C=Leaf then 1 else T_splay x C + 1)"
  "b<x \<Longrightarrow> c<x \<Longrightarrow> T_splay x (Node AB b (Node C c D)) =
  (if D=Leaf then 1 else T_splay x D + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((T_splay a \<langle>l, a, r\<rangle> = 1 &&& (x < b \<Longrightarrow> T_splay x \<langle>\<langle>\<rangle>, b, CD\<rangle> = 1)) &&& (a < b \<Longrightarrow> T_splay a \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> = 1) &&& (\<lbrakk>x < a; x < b\<rbrakk> \<Longrightarrow> T_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> = (if A = \<langle>\<rangle> then 1 else T_splay x A + 1))) &&& ((\<lbrakk>x < b; a < x\<rbrakk> \<Longrightarrow> T_splay x \<langle>\<langle>A, a, B\<rangle>, b, CD\<rangle> = (if B = \<langle>\<rangle> then 1 else T_splay x B + 1)) &&& (b < x \<Longrightarrow> T_splay x \<langle>AB, b, \<langle>\<rangle>\<rangle> = 1)) &&& (b < a \<Longrightarrow> T_splay a \<langle>AB, b, \<langle>C, a, D\<rangle>\<rangle> = 1) &&& (\<lbrakk>b < x; x < c\<rbrakk> \<Longrightarrow> T_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> = (if C = \<langle>\<rangle> then 1 else T_splay x C + 1)) &&& (\<lbrakk>b < x; c < x\<rbrakk> \<Longrightarrow> T_splay x \<langle>AB, b, \<langle>C, c, D\<rangle>\<rangle> = (if D = \<langle>\<rangle> then 1 else T_splay x D + 1))
[PROOF STEP]
by auto


[STATEMENT]
lemma length_Suc_conv_rev: "(length xs = Suc n) = (\<exists>y ys. xs = ys @ [y] \<and> length ys = n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = Suc n) = (\<exists>y ys. xs = ys @ [y] \<and> length ys = n)
[PROOF STEP]
by (induct xs rule: rev_induct) auto


[STATEMENT]
lemma (in module) sum_map_hom:
  fixes M1 M2
  assumes h1: "submodule R M1 M" and h2: "submodule R M2 M"
  shows "mod_hom R (direct_sum (md M1) (md M2)) M (\<lambda> v. (fst v) \<oplus>\<^bsub>M\<^esub> (snd v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_hom R (direct_sum (md M1) (md M2)) M (\<lambda>v. fst v \<oplus>\<^bsub>M\<^esub> snd v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_hom R (direct_sum (md M1) (md M2)) M (\<lambda>v. fst v \<oplus>\<^bsub>M\<^esub> snd v)
[PROOF STEP]
have 0: "module R M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module R M
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
module R M

goal (1 subgoal):
 1. mod_hom R (direct_sum (md M1) (md M2)) M (\<lambda>v. fst v \<oplus>\<^bsub>M\<^esub> snd v)
[PROOF STEP]
from h1
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule R M1 M
[PROOF STEP]
have 1: "module R (md M1)"
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule R M1 M

goal (1 subgoal):
 1. module R (md M1)
[PROOF STEP]
by (rule submodule_is_module)
[PROOF STATE]
proof (state)
this:
module R (md M1)

goal (1 subgoal):
 1. mod_hom R (direct_sum (md M1) (md M2)) M (\<lambda>v. fst v \<oplus>\<^bsub>M\<^esub> snd v)
[PROOF STEP]
from h2
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule R M2 M
[PROOF STEP]
have 2: "module R (md M2)"
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule R M2 M

goal (1 subgoal):
 1. module R (md M2)
[PROOF STEP]
by (rule submodule_is_module)
[PROOF STATE]
proof (state)
this:
module R (md M2)

goal (1 subgoal):
 1. mod_hom R (direct_sum (md M1) (md M2)) M (\<lambda>v. fst v \<oplus>\<^bsub>M\<^esub> snd v)
[PROOF STEP]
from h1
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule R M1 M
[PROOF STEP]
interpret w1: module R "(md M1)"
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule R M1 M

goal (1 subgoal):
 1. module R (md M1)
[PROOF STEP]
by (rule submodule_is_module)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_hom R (direct_sum (md M1) (md M2)) M (\<lambda>v. fst v \<oplus>\<^bsub>M\<^esub> snd v)
[PROOF STEP]
from h2
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule R M2 M
[PROOF STEP]
interpret w2: module R "(md M2)"
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule R M2 M

goal (1 subgoal):
 1. module R (md M2)
[PROOF STEP]
by (rule submodule_is_module)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_hom R (direct_sum (md M1) (md M2)) M (\<lambda>v. fst v \<oplus>\<^bsub>M\<^esub> snd v)
[PROOF STEP]
from 0 h1 h2 1 2
[PROOF STATE]
proof (chain)
picking this:
module R M
LinearCombinations.submodule R M1 M
LinearCombinations.submodule R M2 M
module R (md M1)
module R (md M2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
module R M
LinearCombinations.submodule R M1 M
LinearCombinations.submodule R M2 M
module R (md M1)
module R (md M2)

goal (1 subgoal):
 1. mod_hom R (direct_sum (md M1) (md M2)) M (\<lambda>v. fst v \<oplus>\<^bsub>M\<^esub> snd v)
[PROOF STEP]
apply (unfold mod_hom_def mod_hom_axioms_def module_hom_def, auto)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>module R M; LinearCombinations.submodule R M1 M; LinearCombinations.submodule R M2 M; module R (md M1); module R (md M2)\<rbrakk> \<Longrightarrow> module R (direct_sum (md M1) (md M2))
 2. \<And>a b. \<lbrakk>module R M; LinearCombinations.submodule R M1 M; LinearCombinations.submodule R M2 M; module R (md M1); module R (md M2); (a, b) \<in> carrier (direct_sum (md M1) (md M2))\<rbrakk> \<Longrightarrow> a \<oplus>\<^bsub>M\<^esub> b \<in> carrier M
 3. \<And>a b aa ba. \<lbrakk>module R M; LinearCombinations.submodule R M1 M; LinearCombinations.submodule R M2 M; module R (md M1); module R (md M2); (a, b) \<in> carrier (direct_sum (md M1) (md M2)); (aa, ba) \<in> carrier (direct_sum (md M1) (md M2))\<rbrakk> \<Longrightarrow> fst ((a, b) \<oplus>\<^bsub>direct_sum (md M1) (md M2)\<^esub> (aa, ba)) \<oplus>\<^bsub>M\<^esub> snd ((a, b) \<oplus>\<^bsub>direct_sum (md M1) (md M2)\<^esub> (aa, ba)) = a \<oplus>\<^bsub>M\<^esub> b \<oplus>\<^bsub>M\<^esub> (aa \<oplus>\<^bsub>M\<^esub> ba)
 4. \<And>r a b. \<lbrakk>module R M; LinearCombinations.submodule R M1 M; LinearCombinations.submodule R M2 M; module R (md M1); module R (md M2); r \<in> carrier R; (a, b) \<in> carrier (direct_sum (md M1) (md M2))\<rbrakk> \<Longrightarrow> fst (r \<odot>\<^bsub>direct_sum (md M1) (md M2)\<^esub> (a, b)) \<oplus>\<^bsub>M\<^esub> snd (r \<odot>\<^bsub>direct_sum (md M1) (md M2)\<^esub> (a, b)) = r \<odot>\<^bsub>M\<^esub> (a \<oplus>\<^bsub>M\<^esub> b)
[PROOF STEP]
apply (rule direct_sum_is_module, auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a b. \<lbrakk>module R M; LinearCombinations.submodule R M1 M; LinearCombinations.submodule R M2 M; module R (md M1); module R (md M2); (a, b) \<in> carrier (direct_sum (md M1) (md M2))\<rbrakk> \<Longrightarrow> a \<oplus>\<^bsub>M\<^esub> b \<in> carrier M
 2. \<And>a b aa ba. \<lbrakk>module R M; LinearCombinations.submodule R M1 M; LinearCombinations.submodule R M2 M; module R (md M1); module R (md M2); (a, b) \<in> carrier (direct_sum (md M1) (md M2)); (aa, ba) \<in> carrier (direct_sum (md M1) (md M2))\<rbrakk> \<Longrightarrow> fst ((a, b) \<oplus>\<^bsub>direct_sum (md M1) (md M2)\<^esub> (aa, ba)) \<oplus>\<^bsub>M\<^esub> snd ((a, b) \<oplus>\<^bsub>direct_sum (md M1) (md M2)\<^esub> (aa, ba)) = a \<oplus>\<^bsub>M\<^esub> b \<oplus>\<^bsub>M\<^esub> (aa \<oplus>\<^bsub>M\<^esub> ba)
 3. \<And>r a b. \<lbrakk>module R M; LinearCombinations.submodule R M1 M; LinearCombinations.submodule R M2 M; module R (md M1); module R (md M2); r \<in> carrier R; (a, b) \<in> carrier (direct_sum (md M1) (md M2))\<rbrakk> \<Longrightarrow> fst (r \<odot>\<^bsub>direct_sum (md M1) (md M2)\<^esub> (a, b)) \<oplus>\<^bsub>M\<^esub> snd (r \<odot>\<^bsub>direct_sum (md M1) (md M2)\<^esub> (a, b)) = r \<odot>\<^bsub>M\<^esub> (a \<oplus>\<^bsub>M\<^esub> b)
[PROOF STEP]
apply (unfold direct_sum_def, auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a b. \<lbrakk>module R M; LinearCombinations.submodule R M1 M; LinearCombinations.submodule R M2 M; module R (md M1); module R (md M2); a \<in> M1; b \<in> M2\<rbrakk> \<Longrightarrow> a \<oplus>\<^bsub>M\<^esub> b \<in> carrier M
 2. \<And>a b aa ba. \<lbrakk>module R M; LinearCombinations.submodule R M1 M; LinearCombinations.submodule R M2 M; module R (md M1); module R (md M2); a \<in> M1; b \<in> M2; aa \<in> M1; ba \<in> M2\<rbrakk> \<Longrightarrow> a \<oplus>\<^bsub>M\<^esub> aa \<oplus>\<^bsub>M\<^esub> (b \<oplus>\<^bsub>M\<^esub> ba) = a \<oplus>\<^bsub>M\<^esub> b \<oplus>\<^bsub>M\<^esub> (aa \<oplus>\<^bsub>M\<^esub> ba)
 3. \<And>r a b. \<lbrakk>module R M; LinearCombinations.submodule R M1 M; LinearCombinations.submodule R M2 M; module R (md M1); module R (md M2); r \<in> carrier R; a \<in> M1; b \<in> M2\<rbrakk> \<Longrightarrow> r \<odot>\<^bsub>M\<^esub> a \<oplus>\<^bsub>M\<^esub> r \<odot>\<^bsub>M\<^esub> b = r \<odot>\<^bsub>M\<^esub> (a \<oplus>\<^bsub>M\<^esub> b)
[PROOF STEP]
apply (unfold submodule_def, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b aa ba. \<lbrakk>module R (md M1); module R (md M2); a \<in> M1; b \<in> M2; aa \<in> M1; ba \<in> M2; M1 \<subseteq> carrier M; module R M; \<forall>v. v \<in> M1 \<longrightarrow> (\<forall>w. w \<in> M1 \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> M1); M2 \<subseteq> carrier M; \<zero>\<^bsub>M\<^esub> \<in> M1; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> M1 \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> M1); \<forall>v. v \<in> M2 \<longrightarrow> (\<forall>w. w \<in> M2 \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> M2); \<zero>\<^bsub>M\<^esub> \<in> M2; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> M2 \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> M2)\<rbrakk> \<Longrightarrow> a \<oplus>\<^bsub>M\<^esub> aa \<oplus>\<^bsub>M\<^esub> (b \<oplus>\<^bsub>M\<^esub> ba) = a \<oplus>\<^bsub>M\<^esub> b \<oplus>\<^bsub>M\<^esub> (aa \<oplus>\<^bsub>M\<^esub> ba)
 2. \<And>r a b. \<lbrakk>module R (md M1); module R (md M2); r \<in> carrier R; a \<in> M1; b \<in> M2; M1 \<subseteq> carrier M; module R M; \<forall>v. v \<in> M1 \<longrightarrow> (\<forall>w. w \<in> M1 \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> M1); M2 \<subseteq> carrier M; \<zero>\<^bsub>M\<^esub> \<in> M1; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> M1 \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> M1); \<forall>v. v \<in> M2 \<longrightarrow> (\<forall>w. w \<in> M2 \<longrightarrow> v \<oplus>\<^bsub>M\<^esub> w \<in> M2); \<zero>\<^bsub>M\<^esub> \<in> M2; \<forall>c. c \<in> carrier R \<longrightarrow> (\<forall>v. v \<in> M2 \<longrightarrow> c \<odot>\<^bsub>M\<^esub> v \<in> M2)\<rbrakk> \<Longrightarrow> r \<odot>\<^bsub>M\<^esub> a \<oplus>\<^bsub>M\<^esub> r \<odot>\<^bsub>M\<^esub> b = r \<odot>\<^bsub>M\<^esub> (a \<oplus>\<^bsub>M\<^esub> b)
[PROOF STEP]
by (auto simp add: a_ac smult_r_distr ring_subset_carrier)
[PROOF STATE]
proof (state)
this:
mod_hom R (direct_sum (md M1) (md M2)) M (\<lambda>v. fst v \<oplus>\<^bsub>M\<^esub> snd v)

goal:
No subgoals!
[PROOF STEP]
(*key is a_ac, permutative rewrite rule*)
[PROOF STATE]
proof (state)
this:
mod_hom R (direct_sum (md M1) (md M2)) M (\<lambda>v. fst v \<oplus>\<^bsub>M\<^esub> snd v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_cblinfun_matrix:
  fixes f:: "'b::t2_space \<Rightarrow> 'a::complex_normed_vector \<Rightarrow>\<^sub>C\<^sub>L 'c::complex_inner"
  assumes "continuous F f"
  shows "continuous F (\<lambda>x. (f x) j \<bullet>\<^sub>C i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F (\<lambda>x. cblinfun_apply (f x) j \<bullet>\<^sub>C i)
[PROOF STEP]
by (rule bounded_antilinear.continuous[OF bounded_antilinear_cblinfun_matrix assms])


[STATEMENT]
lemma measure_point_measure_singleton:
  "x \<in> A \<Longrightarrow> measure (point_measure A X) {x} = enn2real (X x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> A \<Longrightarrow> Sigma_Algebra.measure (point_measure A X) {x} = enn2real (X x)
[PROOF STEP]
unfolding measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> A \<Longrightarrow> enn2real (emeasure (point_measure A X) {x}) = enn2real (X x)
[PROOF STEP]
by (subst emeasure_point_measure_finite2) auto


[STATEMENT]
lemma cos_minus [simp]: "cos (-x) = cos x"
  for x :: "'a::{real_normed_algebra_1,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (- x) = cos x
[PROOF STEP]
using cos_minus_converges [of x]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. cos_coeff n *\<^sub>R (- x) ^ n) sums cos x

goal (1 subgoal):
 1. cos (- x) = cos x
[PROOF STEP]
by (simp add: cos_def summable_norm_cos [THEN summable_norm_cancel]
      suminf_minus sums_iff equation_minus_iff)


[STATEMENT]
lemma fst_divide_out [simp]: "fst (divide_out p x) = x div p ^ multiplicity p x"
  and snd_divide_out [simp]: "snd (divide_out p x) = multiplicity p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (divide_out p x) = x div p ^ multiplicity p x &&& snd (divide_out p x) = multiplicity p x
[PROOF STEP]
by (simp_all add: divide_out_def)


[STATEMENT]
lemma suffix_suffix [simp]: "suffix m (suffix k x) = suffix (k+m) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suffix m (suffix k x) = suffix (k + m) x
[PROOF STEP]
by (rule ext) (simp add: suffix_def add.assoc)


[STATEMENT]
lemma has_field_derivative_sinh [THEN DERIV_chain2, derivative_intros]:
  "(sinh has_field_derivative cosh x) (at (x :: 'a :: {banach, real_normed_field}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sinh has_field_derivative cosh x) (at x)
[PROOF STEP]
unfolding sinh_def cosh_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (exp x - exp (- x)) /\<^sub>R 2) has_field_derivative (exp x + exp (- x)) /\<^sub>R 2) (at x)
[PROOF STEP]
by (auto intro!: derivative_eq_intros)


[STATEMENT]
lemma aug_bpp_closed:"\<lbrakk>assoc_bpp (aug_pm_set z i A) f;
      x \<in> addition_set f (aug_pm_set z i A);
      y \<in> addition_set f (aug_pm_set z i A)\<rbrakk> \<Longrightarrow>
                  x \<^sub>f+ y \<in> addition_set f (aug_pm_set z i A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>assoc_bpp (aug_pm_set z i A) f; x \<in> addition_set f (aug_pm_set z i A); y \<in> addition_set f (aug_pm_set z i A)\<rbrakk> \<Longrightarrow> x \<^sub>f+ y \<in> addition_set f (aug_pm_set z i A)
[PROOF STEP]
apply (simp add:bpp_closed [of "aug_pm_set z i A" "f"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sparse_row_vector_add: "sparse_row_vector (add_spvec a b) = (sparse_row_vector a) + (sparse_row_vector b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sparse_row_vector (add_spvec a b) = sparse_row_vector a + sparse_row_vector b
[PROOF STEP]
apply (induct a b rule: add_spvec.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>arr. sparse_row_vector (add_spvec arr []) = sparse_row_vector arr + sparse_row_vector []
 2. \<And>v va. sparse_row_vector (add_spvec [] (v # va)) = sparse_row_vector [] + sparse_row_vector (v # va)
 3. \<And>i a arr j b brr. \<lbrakk>i < j \<Longrightarrow> sparse_row_vector (add_spvec arr ((j, b) # brr)) = sparse_row_vector arr + sparse_row_vector ((j, b) # brr); \<lbrakk>\<not> i < j; j < i\<rbrakk> \<Longrightarrow> sparse_row_vector (add_spvec ((i, a) # arr) brr) = sparse_row_vector ((i, a) # arr) + sparse_row_vector brr; \<lbrakk>\<not> i < j; \<not> j < i\<rbrakk> \<Longrightarrow> sparse_row_vector (add_spvec arr brr) = sparse_row_vector arr + sparse_row_vector brr\<rbrakk> \<Longrightarrow> sparse_row_vector (add_spvec ((i, a) # arr) ((j, b) # brr)) = sparse_row_vector ((i, a) # arr) + sparse_row_vector ((j, b) # brr)
[PROOF STEP]
apply (simp_all add: singleton_matrix_add)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma l9:
  "x \<le> y \<Longrightarrow> -y \<le> -x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> - y \<le> - x
[PROOF STEP]
by (metis l10 a_inf_complement_bot il_commutative il_less_eq il_sub_inf_right_isotone il_unit_bot)


[STATEMENT]
lemma measure_eq_AE:
  assumes iff: "AE x in M. x \<in> A \<longleftrightarrow> x \<in> B"
  assumes A: "A \<in> sets M" and B: "B \<in> sets M"
  shows "measure M A = measure M B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M A = Sigma_Algebra.measure M B
[PROOF STEP]
using assms emeasure_eq_AE[OF assms]
[PROOF STATE]
proof (prove)
using this:
AE x in M. (x \<in> A) = (x \<in> B)
A \<in> sets M
B \<in> sets M
emeasure M A = emeasure M B

goal (1 subgoal):
 1. Sigma_Algebra.measure M A = Sigma_Algebra.measure M B
[PROOF STEP]
by (simp add: measure_def)


[STATEMENT]
lemma vec_plus[simp]:
assumes "dims A = dims B"
shows "vec (A+B) = vec_plus (vec A) (vec B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (A + B) = vec_plus (vec A) (vec B)
[PROOF STEP]
unfolding plus_def plus_base_def vec_plus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (if dims A = dims B then tensor_from_vec (dims A) (map2 (+) (vec A) (vec B)) else undefined) = map2 (+) (vec A) (vec B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dims A = dims B

goal (1 subgoal):
 1. vec (if dims A = dims B then tensor_from_vec (dims A) (map2 (+) (vec A) (vec B)) else undefined) = map2 (+) (vec A) (vec B)
[PROOF STEP]
by (auto; metis (no_types, lifting) length_map length_tensor_vec_from_lookup map_fst_zip tensor_lookup tensor_from_lookup_def vec_tensor)


[STATEMENT]
lemma topological_basisI:
  assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'"
    and "\<And>O' x. open O' \<Longrightarrow> x \<in> O' \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'"
  shows "topological_basis B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topological_basis B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?B' \<in> B \<Longrightarrow> open ?B'
\<lbrakk>open ?O'; ?x \<in> ?O'\<rbrakk> \<Longrightarrow> \<exists>B'\<in>B. ?x \<in> B' \<and> B' \<subseteq> ?O'

goal (1 subgoal):
 1. topological_basis B
[PROOF STEP]
by (subst topological_basis_iff) auto


[STATEMENT]
lemma test_bit_2p: "bit (word_of_int (2 ^ n)::'a::len word) m \<longleftrightarrow> m = n \<and> m < LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bit (word_of_int (2 ^ n)) m = (m = n \<and> m < LENGTH('a))
[PROOF STEP]
by transfer (auto simp add: bit_exp_iff)


[STATEMENT]
lemma iprev_mono2: "\<lbrakk> n \<in> I; \<exists>x\<in>I. x < n\<rbrakk> \<Longrightarrow> iprev n I < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<in> I; \<exists>x\<in>I. x < n\<rbrakk> \<Longrightarrow> iprev n I < n
[PROOF STEP]
apply (unfold iprev_def i_cut_defs, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>n \<in> I; x \<in> I; x < n\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> I \<and> x < n
[PROOF STEP]
apply (blast intro: finite_nat_iff_bounded)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inv_app2'[simp]: "invertible\<^sub>L X \<Longrightarrow> X (inv\<^sub>L X v) = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible\<^sub>L X \<Longrightarrow> blinfun_apply X (blinfun_apply (inv\<^sub>L X) v) = v
[PROOF STEP]
using inv_app2 blinfun_apply_blinfun_compose id_blinfun.rep_eq
[PROOF STATE]
proof (prove)
using this:
invertible\<^sub>L ?X \<Longrightarrow> ?X o\<^sub>L inv\<^sub>L ?X = id_blinfun
blinfun_apply (?a o\<^sub>L ?b) ?c = blinfun_apply ?a (blinfun_apply ?b ?c)
blinfun_apply id_blinfun = (\<lambda>x. x)

goal (1 subgoal):
 1. invertible\<^sub>L X \<Longrightarrow> blinfun_apply X (blinfun_apply (inv\<^sub>L X) v) = v
[PROOF STEP]
by metis


[STATEMENT]
lemma face_of_refl_eq: "S face_of S \<longleftrightarrow> convex S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S face_of S) = convex S
[PROOF STEP]
by (auto simp: face_of_def)


[STATEMENT]
lemma eSuc_inject [simp]: "eSuc m = eSuc n \<longleftrightarrow> m = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eSuc m = eSuc n) = (m = n)
[PROOF STEP]
by (simp add: eSuc_def split: enat.splits)


[STATEMENT]
lemma visits_via_monotone: "\<lbrakk> visits_via P A W; A \<subseteq> A' \<rbrakk> \<Longrightarrow> visits_via P A' W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>visits_via P A W; A \<subseteq> A'\<rbrakk> \<Longrightarrow> visits_via P A' W
[PROOF STEP]
unfolding visits_via_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>n. enat n < llength P \<and> P $ n \<in> W \<and> lset (ltake (enat n) P) \<subseteq> A; A \<subseteq> A'\<rbrakk> \<Longrightarrow> \<exists>n. enat n < llength P \<and> P $ n \<in> W \<and> lset (ltake (enat n) P) \<subseteq> A'
[PROOF STEP]
by blast


[STATEMENT]
lemma floor_less_numeral [simp]: "\<lfloor>x\<rfloor> < numeral v \<longleftrightarrow> x < numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> < numeral v) = (x < numeral v)
[PROOF STEP]
by (simp add: floor_less_iff)


[STATEMENT]
lemma subst_pp_zero [simp]: "subst_pp f 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_pp f 0 = 1
[PROOF STEP]
by (simp add: subst_pp_def)


[STATEMENT]
lemma sum_multiset_singleton [simp]: "sum (\<lambda>n. {#n#}) A = mset_set A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n\<in>A. {#n#}) = mset_set A
[PROOF STEP]
by (induction A rule: infinite_finite_induct) auto


[STATEMENT]
lemma has_suc_subset: "has (Suc n) S \<Longrightarrow> {} \<subset> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has (Suc n) S \<Longrightarrow> {} \<subset> S
[PROOF STEP]
by (rule psubsetI, (simp add: has_suc_notempty)+)


[STATEMENT]
lemma antisym_genPrefix: "antisym r ==> antisym (genPrefix r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. antisym r \<Longrightarrow> antisym (genPrefix r)
[PROOF STEP]
by (blast intro: antisymI genPrefix_antisym)


[STATEMENT]
lemma bool9: "((P::bool) \<or> False) = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<or> False) = P
[PROOF STEP]
by blast


[STATEMENT]
lemma fsize_def2: "fsize t = 1 + ffold (vadd \<circ> vprod_size) 0 t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fsize t = 1 + ffold (vadd \<circ> vprod_size) 0 t
[PROOF STEP]
using vprod_size_inj[of t] ffold_fimage[of vprod_size t vadd 0]
[PROOF STATE]
proof (prove)
using this:
inj_on vprod_size (fset t)
inj_on vprod_size (fset t) \<Longrightarrow> ffold vadd 0 (vprod_size |`| t) = ffold (vadd \<circ> vprod_size) 0 t

goal (1 subgoal):
 1. fsize t = 1 + ffold (vadd \<circ> vprod_size) 0 t
[PROOF STEP]
by simp


[STATEMENT]
lemma accepting_pair\<^sub>R_simp[simp]:
  "accepting_pair\<^sub>R \<delta> q\<^sub>0 (F,I) w \<equiv> limit (run\<^sub>t \<delta> q\<^sub>0 w) \<inter> F = {} \<and> limit (run\<^sub>t \<delta> q\<^sub>0 w) \<inter> I \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. accepting_pair\<^sub>R \<delta> q\<^sub>0 (F, I) w \<equiv> limit (run\<^sub>t \<delta> q\<^sub>0 w) \<inter> F = {} \<and> limit (run\<^sub>t \<delta> q\<^sub>0 w) \<inter> I \<noteq> {}
[PROOF STEP]
by simp


[STATEMENT]
lemma closed_interval_right:
  fixes a :: "'a::euclidean_space"
  shows "closed {x::'a. \<forall>i\<in>Basis. a\<bullet>i \<le> x\<bullet>i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. \<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i}
[PROOF STEP]
by (simp add: Collect_ball_eq closed_INT closed_Collect_le continuous_on_inner)


[STATEMENT]
lemma set_minus_plus: "a - b \<in> C \<longleftrightarrow> a \<in> b +o C"
  for a b :: "'a::ab_group_add"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - b \<in> C) = (a \<in> b +o C)
[PROOF STEP]
by (meson set_minus_imp_plus set_plus_imp_minus)


[STATEMENT]
lemma word_oa_dist2: "x OR y AND z = (x OR y) AND (x OR z)"
  for x y z :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x OR y AND z = (x OR y) AND (x OR z)
[PROOF STEP]
by (fact bit.disj_conj_distrib)


[STATEMENT]
lemma directed_downset_ideals: "directed (\<Down>X) = (\<Down>X \<in> ideals)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. directed (\<Down> X) = idealp (\<Down> X)
[PROOF STEP]
by (metis (mono_tags, lifting) CollectI Fix_def directed_alt downset_set_idem downclosed_set_def downsets_def ideals_def o_def ord.ideals_directed)


[STATEMENT]
lemma finite'_intersection_of_Int:
   "\<lbrakk>(finite' intersection_of P) S; (finite' intersection_of P) T\<rbrakk>
           \<Longrightarrow> (finite' intersection_of P) (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(finite' intersection_of P) S; (finite' intersection_of P) T\<rbrakk> \<Longrightarrow> (finite' intersection_of P) (S \<inter> T)
[PROOF STEP]
by (auto simp: intersection_of_def)


[STATEMENT]
lemma mset_sorted_list_of_set[simp]: "mset (sorted_list_of_set A) = mset_set A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (sorted_list_of_set A) = mset_set A
[PROOF STEP]
by (metis mset_sorted_list_of_multiset sorted_list_of_mset_set)


[STATEMENT]
lemma not_zless:"(\<not> (n::int) < m) = (m \<le> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> n < m) = (m \<le> n)
[PROOF STEP]
by auto


[STATEMENT]
lemma shuffle_UNION_distrib:
shows "A \<parallel> \<Union>(M ` I) = \<Union>((%i. A \<parallel> M i) ` I)"
and   "\<Union>(M ` I) \<parallel> A = \<Union>((%i. M i \<parallel> A) ` I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<parallel> \<Union> (M ` I) = (\<Union>i\<in>I. A \<parallel> M i) &&& \<Union> (M ` I) \<parallel> A = (\<Union>i\<in>I. M i \<parallel> A)
[PROOF STEP]
unfolding Shuffle_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {shuffles xs ys |xs ys. xs \<in> A \<and> ys \<in> \<Union> (M ` I)} = (\<Union>i\<in>I. \<Union> {shuffles xs ys |xs ys. xs \<in> A \<and> ys \<in> M i}) &&& \<Union> {shuffles xs ys |xs ys. xs \<in> \<Union> (M ` I) \<and> ys \<in> A} = (\<Union>i\<in>I. \<Union> {shuffles xs ys |xs ys. xs \<in> M i \<and> ys \<in> A})
[PROOF STEP]
by fast+


[STATEMENT]
lemma RDirProd_list_carrier_def':
  shows "carrier (RDirProd_list Rs) = carrier (DirProd_list Rs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (RDirProd_list Rs) = carrier (DirProd_list Rs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. carrier (RDirProd_list Rs) = carrier (DirProd_list Rs)
[PROOF STEP]
have "carrier (RDirProd_list Rs) = carrier (monoid.truncate (RDirProd_list Rs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (RDirProd_list Rs) = carrier (monoid.truncate (RDirProd_list Rs))
[PROOF STEP]
by (simp add: monoid.defs)
[PROOF STATE]
proof (state)
this:
carrier (RDirProd_list Rs) = carrier (monoid.truncate (RDirProd_list Rs))

goal (1 subgoal):
 1. carrier (RDirProd_list Rs) = carrier (DirProd_list Rs)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
carrier (RDirProd_list Rs) = carrier (monoid.truncate (RDirProd_list Rs))

goal (1 subgoal):
 1. carrier (RDirProd_list Rs) = carrier (DirProd_list Rs)
[PROOF STEP]
unfolding RDirProd_list_truncate
[PROOF STATE]
proof (prove)
using this:
carrier (RDirProd_list Rs) = carrier (DirProd_list Rs)

goal (1 subgoal):
 1. carrier (RDirProd_list Rs) = carrier (DirProd_list Rs)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
carrier (RDirProd_list Rs) = carrier (DirProd_list Rs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subset_interior_of_eq: "S \<subseteq> X interior_of S \<longleftrightarrow> openin X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S \<subseteq> X interior_of S) = openin X S
[PROOF STEP]
by (metis interior_of_eq interior_of_subset subset_antisym)


[STATEMENT]
lemma i_set0_i_set_mem_conv: "(I \<in> i_set0) = (I \<in> i_set \<or> I = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (I \<in> i_set0) = (I \<in> i_set \<or> I = {})
[PROOF STEP]
apply (simp add: i_set_i_set_ind_eq i_set0_i_set0_ind_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (I \<in> i_set0_ind) = (I \<in> i_set_ind \<or> I = {})
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. I \<in> i_set0_ind \<Longrightarrow> I \<in> i_set_ind \<or> I = {}
 2. I \<in> i_set_ind \<or> I = {} \<Longrightarrow> I \<in> i_set0_ind
[PROOF STEP]
apply (rule i_set0_ind.cases[of I])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. I \<in> i_set0_ind \<Longrightarrow> I \<in> i_set0_ind
 2. \<lbrakk>I \<in> i_set0_ind; I = {}\<rbrakk> \<Longrightarrow> I \<in> i_set_ind \<or> I = {}
 3. \<And>Ia. \<lbrakk>I \<in> i_set0_ind; I = Ia; Ia \<in> i_set_ind\<rbrakk> \<Longrightarrow> I \<in> i_set_ind \<or> I = {}
 4. I \<in> i_set_ind \<or> I = {} \<Longrightarrow> I \<in> i_set0_ind
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_distinct:
  assumes "finite A" shows "finite {p. distinct p \<and> set p \<subseteq> A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {p. distinct p \<and> set p \<subseteq> A}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {p. distinct p \<and> set p \<subseteq> A}
[PROOF STEP]
have "{p. distinct p \<and> set p \<subseteq> A} \<subseteq> {p. set p \<subseteq> A \<and> length p \<le> card A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> A} \<subseteq> {p. set p \<subseteq> A \<and> length p \<le> card A}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. {p. distinct p \<and> set p \<subseteq> A} \<subseteq> {p. set p \<subseteq> A \<and> length p \<le> card A}
[PROOF STEP]
by (auto simp: distinct_card[symmetric] intro: card_mono)
[PROOF STATE]
proof (state)
this:
{p. distinct p \<and> set p \<subseteq> A} \<subseteq> {p. set p \<subseteq> A \<and> length p \<le> card A}

goal (1 subgoal):
 1. finite {p. distinct p \<and> set p \<subseteq> A}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{p. distinct p \<and> set p \<subseteq> A} \<subseteq> {p. set p \<subseteq> A \<and> length p \<le> card A}

goal (1 subgoal):
 1. finite {p. distinct p \<and> set p \<subseteq> A}
[PROOF STEP]
have "finite ..."
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {p. set p \<subseteq> A \<and> length p \<le> card A}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. finite {p. set p \<subseteq> A \<and> length p \<le> card A}
[PROOF STEP]
by (simp add: finite_lists_length_le)
[PROOF STATE]
proof (state)
this:
finite {p. set p \<subseteq> A \<and> length p \<le> card A}

goal (1 subgoal):
 1. finite {p. distinct p \<and> set p \<subseteq> A}
[PROOF STEP]
finally (finite_subset)
[PROOF STATE]
proof (chain)
picking this:
finite {p. distinct p \<and> set p \<subseteq> A}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {p. distinct p \<and> set p \<subseteq> A}

goal (1 subgoal):
 1. finite {p. distinct p \<and> set p \<subseteq> A}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite {p. distinct p \<and> set p \<subseteq> A}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma AE_E[consumes 1]:
  assumes "AE x in M. P x"
  obtains N where "{x \<in> space M. \<not> P x} \<subseteq> N" "emeasure M N = 0" "N \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. \<lbrakk>{x \<in> space M. \<not> P x} \<subseteq> N; emeasure M N = 0; N \<in> sets M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
almost_everywhere M P

goal (1 subgoal):
 1. (\<And>N. \<lbrakk>{x \<in> space M. \<not> P x} \<subseteq> N; emeasure M N = 0; N \<in> sets M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_ae_filter
[PROOF STATE]
proof (prove)
using this:
Bex (null_sets M) ((\<subseteq>) {x \<in> space M. \<not> P x})

goal (1 subgoal):
 1. (\<And>N. \<lbrakk>{x \<in> space M. \<not> P x} \<subseteq> N; emeasure M N = 0; N \<in> sets M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma lift_opts_exists:
  "\<forall>x\<in>set ty_ty'_list. (\<lambda>(ty, ty'). is_sty_one P ty ty' = Some True) x \<Longrightarrow> \<exists>bools. lift_opts (map (\<lambda>(ty, ty'). is_sty_one P ty ty') ty_ty'_list) = Some bools"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set ty_ty'_list. case x of (ty, ty') \<Rightarrow> is_sty_one P ty ty' = Some True \<Longrightarrow> \<exists>bools. lift_opts (map (\<lambda>(ty, ty'). is_sty_one P ty ty') ty_ty'_list) = Some bools
[PROOF STEP]
by (induct ty_ty'_list, auto)


[STATEMENT]
lemma
  digitToTree_inv: "is_leveln_digit n d \<Longrightarrow> is_leveln_ftree n (digitToTree d)"
  "is_measured_digit d \<Longrightarrow> is_measured_ftree (digitToTree d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (is_leveln_digit n d \<Longrightarrow> is_leveln_ftree n (digitToTree d)) &&& (is_measured_digit d \<Longrightarrow> is_measured_ftree (digitToTree d))
[PROOF STEP]
apply (cases d,auto simp add: deep_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_measured_digit d \<Longrightarrow> is_measured_ftree (digitToTree d)
[PROOF STEP]
apply (cases d,auto simp add: deep_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma plus_mult_cpx [simp]:
  "plus_mult 1 (*) 0 (+) (a_inv cpx_rng)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. plus_mult 1 (*) 0 (+) (a_inv cpx_rng)
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (12 subgoals):
 1. \<And>a b. a * b = b * a
 2. \<And>a b c. a * b * c = a * (b * c)
 3. \<And>x. 1 * x = x
 4. \<And>x. x * 1 = x
 5. \<And>a b. a + b = b + a
 6. \<And>a b c. a + b + c = a + (b + c)
 7. \<And>x. 0 + x = x
 8. \<And>x. x + 0 = x
 9. \<And>a b c. a * (b + c) = a * b + a * c
 10. \<And>a b c. (a + b) * c = a * c + b * c
A total of 12 subgoals...
[PROOF STEP]
apply (auto intro: cpx_cring_is_field simp: field_simps)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x + \<ominus>\<^bsub>cpx_rng\<^esub> x = 0
 2. \<And>x. x + \<ominus>\<^bsub>cpx_rng\<^esub> x = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x + \<ominus>\<^bsub>cpx_rng\<^esub> x = 0
 2. \<And>x. x + \<ominus>\<^bsub>cpx_rng\<^esub> x = 0
[PROOF STEP]
show "\<And>x. x + \<ominus>\<^bsub>cpx_rng\<^esub> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x + \<ominus>\<^bsub>cpx_rng\<^esub> x = 0
[PROOF STEP]
using group.r_inv[of "cpx_rng"] cpx_cring_is_field field_def domain_def cpx_rng_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Group.group cpx_rng; ?x \<in> carrier cpx_rng\<rbrakk> \<Longrightarrow> ?x \<otimes>\<^bsub>cpx_rng\<^esub> inv\<^bsub>cpx_rng\<^esub> ?x = \<one>\<^bsub>cpx_rng\<^esub>
field cpx_rng
field ?R \<equiv> domain ?R \<and> field_axioms ?R
domain ?R \<equiv> cring ?R \<and> domain_axioms ?R
cpx_rng \<equiv> \<lparr>carrier = UNIV, monoid.mult = (*), one = 1, zero = 0, add = (+)\<rparr>

goal (1 subgoal):
 1. \<And>x. x + \<ominus>\<^bsub>cpx_rng\<^esub> x = 0
[PROOF STEP]
by (metis UNIV_I cring.cring_simprules(17) ordered_semiring_record_simps(1)
        ordered_semiring_record_simps(11) ordered_semiring_record_simps(12))
[PROOF STATE]
proof (state)
this:
?x + \<ominus>\<^bsub>cpx_rng\<^esub> ?x = 0

goal (1 subgoal):
 1. \<And>x. x + \<ominus>\<^bsub>cpx_rng\<^esub> x = 0
[PROOF STEP]
show "\<And>x. x + \<ominus>\<^bsub>cpx_rng\<^esub> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x + \<ominus>\<^bsub>cpx_rng\<^esub> x = 0
[PROOF STEP]
using group.r_inv[of "cpx_rng"] cpx_cring_is_field field_def domain_def cpx_rng_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Group.group cpx_rng; ?x \<in> carrier cpx_rng\<rbrakk> \<Longrightarrow> ?x \<otimes>\<^bsub>cpx_rng\<^esub> inv\<^bsub>cpx_rng\<^esub> ?x = \<one>\<^bsub>cpx_rng\<^esub>
field cpx_rng
field ?R \<equiv> domain ?R \<and> field_axioms ?R
domain ?R \<equiv> cring ?R \<and> domain_axioms ?R
cpx_rng \<equiv> \<lparr>carrier = UNIV, monoid.mult = (*), one = 1, zero = 0, add = (+)\<rparr>

goal (1 subgoal):
 1. \<And>x. x + \<ominus>\<^bsub>cpx_rng\<^esub> x = 0
[PROOF STEP]
by (metis UNIV_I cring.cring_simprules(17) ordered_semiring_record_simps(1)
        ordered_semiring_record_simps(11) ordered_semiring_record_simps(12))
[PROOF STATE]
proof (state)
this:
?x + \<ominus>\<^bsub>cpx_rng\<^esub> ?x = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_list_set_cong [simp]:
  "sorted_list_of_set (fset FS) = sorted_list_of_set (fset FS') \<longleftrightarrow> FS = FS'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sorted_list_of_set (fset FS) = sorted_list_of_set (fset FS')) = (FS = FS')
[PROOF STEP]
by auto


[STATEMENT]
lemma impl_not_or: "\<phi> impl \<psi> = (not \<phi>) or \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xs. \<phi> xs \<longrightarrow> \<psi> xs) = (\<lambda>xs. \<not> \<phi> xs \<or> \<psi> xs)
[PROOF STEP]
by blast


[STATEMENT]
lemma winding_number_less_1:
  fixes z::complex
  shows
  "\<lbrakk>valid_path \<gamma>; z \<notin> path_image \<gamma>; w \<noteq> z;
    \<And>a::real. 0 < a \<Longrightarrow> z + of_real a * (w - z) \<notin> path_image \<gamma>\<rbrakk>
   \<Longrightarrow> Re(winding_number \<gamma> z) < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valid_path \<gamma>; z \<notin> path_image \<gamma>; w \<noteq> z; \<And>a. 0 < a \<Longrightarrow> z + complex_of_real a * (w - z) \<notin> path_image \<gamma>\<rbrakk> \<Longrightarrow> Re (winding_number \<gamma> z) < 1
[PROOF STEP]
by (auto simp: not_less dest: winding_number_big_meets)


[STATEMENT]
lemma iterate_size_correct :
assumes it: "set_iterator it S0"
shows "iterate_size it = card S0 \<and> finite S0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iterate_size it = card S0 \<and> finite S0
[PROOF STEP]
unfolding iterate_size_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. it (\<lambda>_. True) (\<lambda>x. Suc) 0 = card S0 \<and> finite S0
[PROOF STEP]
apply (rule_tac set_iterator_rule_insert_P [OF it,
    where I = "\<lambda>S \<sigma>. \<sigma> = card S \<and> finite S"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0 = card {} \<and> finite {}
 2. \<And>S \<sigma> x. \<lbrakk>True; x \<in> S0 - S; \<sigma> = card S \<and> finite S; S \<subseteq> S0\<rbrakk> \<Longrightarrow> Suc \<sigma> = card (insert x S) \<and> finite (insert x S)
 3. \<And>\<sigma>. \<sigma> = card S0 \<and> finite S0 \<Longrightarrow> \<sigma> = card S0 \<and> finite S0
 4. \<And>\<sigma> S. \<lbrakk>S \<subseteq> S0; S \<noteq> S0; \<not> True; \<sigma> = card S \<and> finite S\<rbrakk> \<Longrightarrow> \<sigma> = card S0 \<and> finite S0
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma VLambda_vsingleton_def: "(\<lambda>i\<in>\<^sub>\<circ>set {j}. f i) = (\<lambda>i\<in>\<^sub>\<circ>set {j}. f j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VLambda (set {j}) f = (\<lambda>i\<in>\<^sub>\<circ>set {j}. f j)
[PROOF STEP]
by auto


[STATEMENT]
lemma norm_vector_1: "norm (x :: _^1) = norm (x$1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x = norm (x $ 1)
[PROOF STEP]
by (simp add: norm_vec_def)


[STATEMENT]
lemma Group_coim:"\<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> Group ( F / gker\<^bsub>F,G\<^esub> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> Group (F / gker\<^bsub>F,G\<^esub> f)
[PROOF STEP]
by (frule gker_normal[of "F" "G" "f"], assumption+,
       simp add:Group.Group_Qg[of "F" "gker\<^bsub>F,G\<^esub> f"])


[STATEMENT]
lemma charpoly_eq: "charpoly A = Cayley_Hamilton.charpoly (from_vec A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cayley_Hamilton_Compatible.charpoly A = Cayley_Hamilton.charpoly (from_vec A)
[PROOF STEP]
unfolding charpoly_def Cayley_Hamilton.charpoly_def det_sq_matrix_eq[symmetric] X_def C_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (from_vec (mat (monom (1::'a) (Suc 0)) - mat2matofpoly A)) = Square_Matrix.det (diag [:0::'a, 1::'a:] - map_sq_matrix (\<lambda>c. [:c:]) (from_vec A))
[PROOF STEP]
apply (intro arg_cong[where f=Square_Matrix.det])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. from_vec (mat (monom (1::'a) (Suc 0)) - mat2matofpoly A) = diag [:0::'a, 1::'a:] - map_sq_matrix (\<lambda>c. [:c:]) (from_vec A)
[PROOF STEP]
apply transfer'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. (\<lambda>i. ($) ((mat (monom (1::'a) (Suc 0)) - mat2matofpoly A) $ i)) = (\<lambda>i j. (if i = j then [:0::'a, 1::'a:] else 0) - [:A $ i $ j:])
[PROOF STEP]
apply (simp add: fun_eq_iff mat_def mat2matofpoly_def C_def monom_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma id_galois: "partial_order A \<Longrightarrow> galois_connection (I\<^sub>g(A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partial_order A \<Longrightarrow> galois_connection (I\<^sub>g A)
[PROOF STEP]
by (simp add: id_galcon_def galois_connection_def galois_connection_axioms_def connection_def)


[STATEMENT]
lemma map_of_map_Pair_key: "map_of (map (\<lambda>k. (k, f k)) xs) x = (if x \<in> set xs then Some (f x) else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (map (\<lambda>k. (k, f k)) xs) x = (if x \<in> set xs then Some (f x) else None)
[PROOF STEP]
by(induct xs) simp_all


[STATEMENT]
lemma finite_dc_crypto: "finite dc_crypto"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite dc_crypto
[PROOF STEP]
using finite_lists_length_eq[where A="UNIV :: bool set"]
[PROOF STATE]
proof (prove)
using this:
finite UNIV \<Longrightarrow> finite {xs. set xs \<subseteq> UNIV \<and> length xs = ?n}

goal (1 subgoal):
 1. finite dc_crypto
[PROOF STEP]
unfolding dc_crypto
[PROOF STATE]
proof (prove)
using this:
finite UNIV \<Longrightarrow> finite {xs. set xs \<subseteq> UNIV \<and> length xs = ?n}

goal (1 subgoal):
 1. finite (Some ` {0..<n} \<times> {xs. length xs = n})
[PROOF STEP]
by simp


[STATEMENT]
lemma cos_pi [simp]: "cos pi = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos pi = - 1
[PROOF STEP]
using cos_add [where x = "pi/2" and y = "pi/2"]
[PROOF STATE]
proof (prove)
using this:
cos (pi / 2 + pi / 2) = cos (pi / 2) * cos (pi / 2) - sin (pi / 2) * sin (pi / 2)

goal (1 subgoal):
 1. cos pi = - 1
[PROOF STEP]
by simp


[STATEMENT]
theorem CT_sound: "CT_holds var \<theta> \<theta>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CT_holds var \<theta> \<theta>'
[PROOF STEP]
apply(simp only: CT_holds_def valid_def equals_sem vec_extensionality vec_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>I \<nu>. is_interp I \<longrightarrow> dterm_sem I \<theta> \<nu> = dterm_sem I \<theta>' \<nu>) \<longrightarrow> (\<forall>I \<nu>. is_interp I \<longrightarrow> dterm_sem I ($f var (singleton \<theta>)) \<nu> = dterm_sem I ($f var (singleton \<theta>')) \<nu>)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>I. is_interp I \<longrightarrow> (\<forall>a b. dterm_sem I \<theta> (a, b) = dterm_sem I \<theta>' (a, b))) \<longrightarrow> (\<forall>I. is_interp I \<longrightarrow> (\<forall>a b. Functions I var (\<chi>i. dterm_sem I (if i = vid1 then \<theta> else Const 0) (a, b)) = Functions I var (\<chi>i. dterm_sem I (if i = vid1 then \<theta>' else Const 0) (a, b))))
[PROOF STEP]
apply(rule allI | rule impI)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>I a b. \<lbrakk>\<forall>I. is_interp I \<longrightarrow> (\<forall>a b. dterm_sem I \<theta> (a, b) = dterm_sem I \<theta>' (a, b)); is_interp I\<rbrakk> \<Longrightarrow> Functions I var (\<chi>i. dterm_sem I (if i = vid1 then \<theta> else Const 0) (a, b)) = Functions I var (\<chi>i. dterm_sem I (if i = vid1 then \<theta>' else Const 0) (a, b))
[PROOF STEP]
apply(simp add: CT_lemma)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma flow_to_path_unfold:
  shows "flow_to_path x t t' s = flow0 x ((1 - s) * t + s * t')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flow_to_path x t t' s = flow0 x ((1 - s) * t + s * t')
[PROOF STEP]
unfolding flow_to_path_def o_def linepath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flow0 x ((1 - s) *\<^sub>R t + s *\<^sub>R t') = flow0 x ((1 - s) * t + s * t')
[PROOF STEP]
by auto


[STATEMENT]
lemma "(p1 \<and> p2) \<or> p3 \<longrightarrow> (p1 \<longrightarrow> (p3 \<and> p2) \<or> (p1 \<and> p3)) \<or> p1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p1 \<and> p2 \<or> p3 \<longrightarrow> (p1 \<longrightarrow> p3 \<and> p2 \<or> p1 \<and> p3) \<or> p1
[PROOF STEP]
by smt


[STATEMENT]
lemma less_\<omega>1_imp_countable:
  assumes "\<alpha> \<in> elts \<omega>1"
  shows "countable (elts \<alpha>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (elts \<alpha>)
[PROOF STEP]
using Ord_\<omega>1 Ord_in_Ord OrdmemD assms countable_iff_less_\<omega>1
[PROOF STATE]
proof (prove)
using this:
Ord \<omega>1
\<lbrakk>Ord ?k; ?m \<in> elts ?k\<rbrakk> \<Longrightarrow> Ord ?m
\<lbrakk>Ord ?k; ?j \<in> elts ?k\<rbrakk> \<Longrightarrow> ?j < ?k
\<alpha> \<in> elts \<omega>1
Ord ?\<alpha> \<Longrightarrow> countable (elts ?\<alpha>) = (?\<alpha> < \<omega>1)

goal (1 subgoal):
 1. countable (elts \<alpha>)
[PROOF STEP]
by blast


[STATEMENT]
lemma Fvars_ball[simp]:
"x \<in> var \<Longrightarrow> \<phi> \<in> fmla \<Longrightarrow> t \<in> trm \<Longrightarrow> Fvars (ball x t \<phi>) = (Fvars \<phi> \<union> FvarsT t) - {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> var; \<phi> \<in> fmla; t \<in> trm\<rbrakk> \<Longrightarrow> Fvars (ball x t \<phi>) = Fvars \<phi> \<union> FvarsT t - {x}
[PROOF STEP]
unfolding ball_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> var; \<phi> \<in> fmla; t \<in> trm\<rbrakk> \<Longrightarrow> Fvars (all x (imp (LLq (Var x) t) \<phi>)) = Fvars \<phi> \<union> FvarsT t - {x}
[PROOF STEP]
by auto


[STATEMENT]
lemma eqButUID12_cong:
assumes "eqButUID12 freq freq1"
(*and "uid = UID1 \<Longrightarrow> eqButUID2 uu uu1"*)
and "\<not> (uid,uid') \<in> {(UID1,UID2), (UID2,UID1)} \<Longrightarrow> uu = uu1"
shows "eqButUID12 (fun_upd2 freq uid uid' uu) (fun_upd2 freq1 uid uid' uu1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eqButUID12 (fun_upd2 freq uid uid' uu) (fun_upd2 freq1 uid uid' uu1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
eqButUID12 freq freq1
(uid, uid') \<notin> {(UID1, UID2), (UID2, UID1)} \<Longrightarrow> uu = uu1

goal (1 subgoal):
 1. eqButUID12 (fun_upd2 freq uid uid' uu) (fun_upd2 freq1 uid uid' uu1)
[PROOF STEP]
unfolding eqButUID12_def fun_upd2_def
[PROOF STATE]
proof (prove)
using this:
\<forall>uid uid'. if (uid, uid') \<in> {(UID1, UID2), (UID2, UID1)} then True else freq uid uid' = freq1 uid uid'
(uid, uid') \<notin> {(UID1, UID2), (UID2, UID1)} \<Longrightarrow> uu = uu1

goal (1 subgoal):
 1. \<forall>uida uid'a. if (uida, uid'a) \<in> {(UID1, UID2), (UID2, UID1)} then True else (if uid = uida \<and> uid' = uid'a then uu else freq uida uid'a) = (if uid = uida \<and> uid' = uid'a then uu1 else freq1 uida uid'a)
[PROOF STEP]
by (auto split: if_splits)


[STATEMENT]
lemma mulex1_union:
  "mulex1 P M N \<Longrightarrow> mulex1 P (K + M) (K + N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mulex1 P M N \<Longrightarrow> mulex1 P (K + M) (K + N)
[PROOF STEP]
by (auto simp: mulex1_def mult1_union)


[STATEMENT]
lemma m_ivl_anti_mono: "y \<le> x \<Longrightarrow> m_ivl x \<le> m_ivl y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> x \<Longrightarrow> m_ivl x \<le> m_ivl y
[PROOF STEP]
by transfer
   (auto simp: m_rep_def is_empty_rep_def \<gamma>_rep_cases le_iff_subset
         split: prod.split extended.splits if_splits)


[STATEMENT]
lemma uint_numeral: "uint (numeral b :: 'a::len word) = numeral b mod 2 ^ LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uint (numeral b) = numeral b mod 2 ^ LENGTH('a)
[PROOF STEP]
by (simp flip: take_bit_eq_mod add: of_nat_take_bit)


[STATEMENT]
lemma f_Exec_Stream_Init_nth_gr0_calc: "
  \<lbrakk> n \<le> length xs; 0 < n \<rbrakk> \<Longrightarrow>
  f_Exec_Comp_Stream_Init trans_fun xs c ! n =
  trans_fun (xs ! (n - 1)) (f_Exec_Comp_Stream_Init trans_fun xs c ! (n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<le> length xs; 0 < n\<rbrakk> \<Longrightarrow> f_Exec_Comp_Stream_Init trans_fun xs c ! n = trans_fun (xs ! (n - 1)) (f_Exec_Comp_Stream_Init trans_fun xs c ! (n - 1))
[PROOF STEP]
by (clarsimp simp: gr0_conv_Suc f_Exec_Stream_Init_nth_Suc_calc)


[STATEMENT]
lemma uminus_Pair [simp, code]: "- (a, b) = (- a, - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (a, b) = (- a, - b)
[PROOF STEP]
unfolding uminus_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- fst (a, b), - snd (a, b)) = (- a, - b)
[PROOF STEP]
by simp


[STATEMENT]
lemma inverse_permutation_of_list_unique':
  "distinct (map snd xs) \<Longrightarrow> (x, y) \<in> set xs \<Longrightarrow> inverse_permutation_of_list xs y = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct (map snd xs); (x, y) \<in> set xs\<rbrakk> \<Longrightarrow> inverse_permutation_of_list xs y = x
[PROOF STEP]
by (induct xs) (force simp: inverse_permutation_of_list.simps(2))+


[STATEMENT]
lemma Sublists_subset_Subseqs: "Sublists A \<subseteq> Subseqs A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sublists A \<subseteq> Subseqs A
[PROOF STEP]
by (auto simp: Sublists_def Subseqs_def dest!: sublist_imp_subseq)


[STATEMENT]
lemma Diff_weaken_left: "A \<subseteq> C \<Longrightarrow> A - B |- p \<Longrightarrow> C - B |- p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> C; A - B |- p\<rbrakk> \<Longrightarrow> C - B |- p
[PROOF STEP]
by (rule Diff_mono [OF _ subset_refl, THEN weaken_left])


[STATEMENT]
lemma strongly_accepts_empty [simp]: "strongly_accepts \<F> {} M \<longleftrightarrow> (\<forall>N\<subseteq>M. Fpow N \<inter> \<F> = {} \<longrightarrow> finite N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strongly_accepts \<F> {} M = (\<forall>N\<subseteq>M. Fpow N \<inter> \<F> = {} \<longrightarrow> finite N)
[PROOF STEP]
by (simp add: strongly_accepts_def Fpow_def disjoint_iff)


[STATEMENT]
lemma greater_sum_both:
  assumes "pgte a (padd b c)"
  shows "\<exists>a1 a2. a = padd a1 a2 \<and> pgte a1 b \<and> pgte a2 c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a1 a2. a = padd a1 a2 \<and> pgte a1 b \<and> pgte a2 c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a1 a2. a = padd a1 a2 \<and> pgte a1 b \<and> pgte a2 c
[PROOF STEP]
obtain aa bb cc where "aa = Rep_prat a" "bb = Rep_prat b" "cc = Rep_prat c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>aa bb cc. \<lbrakk>aa = Rep_prat a; bb = Rep_prat b; cc = Rep_prat c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
aa = Rep_prat a
bb = Rep_prat b
cc = Rep_prat c

goal (1 subgoal):
 1. \<exists>a1 a2. a = padd a1 a2 \<and> pgte a1 b \<and> pgte a2 c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aa = Rep_prat a
bb = Rep_prat b
cc = Rep_prat c
[PROOF STEP]
have "aa \<ge> bb + cc"
[PROOF STATE]
proof (prove)
using this:
aa = Rep_prat a
bb = Rep_prat b
cc = Rep_prat c

goal (1 subgoal):
 1. bb + cc \<le> aa
[PROOF STEP]
using assms padd.rep_eq pgte.rep_eq
[PROOF STATE]
proof (prove)
using this:
aa = Rep_prat a
bb = Rep_prat b
cc = Rep_prat c
pgte a (padd b c)
Rep_prat (padd ?x ?xa) = Rep_prat ?x + Rep_prat ?xa
pgte ?x ?xa = (Rep_prat ?xa \<le> Rep_prat ?x)

goal (1 subgoal):
 1. bb + cc \<le> aa
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bb + cc \<le> aa

goal (1 subgoal):
 1. \<exists>a1 a2. a = padd a1 a2 \<and> pgte a1 b \<and> pgte a2 c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bb + cc \<le> aa
[PROOF STEP]
obtain x where "aa = bb + x" "x \<ge> cc"
[PROOF STATE]
proof (prove)
using this:
bb + cc \<le> aa

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>aa = bb + x; cc \<le> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis add.commute add_le_cancel_left diff_add_cancel)
[PROOF STATE]
proof (state)
this:
aa = bb + x
cc \<le> x

goal (1 subgoal):
 1. \<exists>a1 a2. a = padd a1 a2 \<and> pgte a1 b \<and> pgte a2 c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aa = bb + x
cc \<le> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
aa = bb + x
cc \<le> x

goal (1 subgoal):
 1. \<exists>a1 a2. a = padd a1 a2 \<and> pgte a1 b \<and> pgte a2 c
[PROOF STEP]
by (metis assms order_refl p_greater_exists padd_asso pgte.rep_eq)
[PROOF STATE]
proof (state)
this:
\<exists>a1 a2. a = padd a1 a2 \<and> pgte a1 b \<and> pgte a2 c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_cos_eq:
  assumes "-pi/2 \<le> \<alpha> \<and> \<alpha> \<le> pi/2"
  assumes "a \<ge> 0" and "a < 1"
  shows "\<exists> \<alpha>'. -pi/2 \<le> \<alpha>' \<and> \<alpha>' \<le> pi/2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
have "arccos a > 0" "arccos a \<le> pi/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < arccos a &&& arccos a \<le> pi / 2
[PROOF STEP]
using \<open>a \<ge> 0\<close> \<open>a < 1\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> a
a < 1

goal (1 subgoal):
 1. 0 < arccos a &&& arccos a \<le> pi / 2
[PROOF STEP]
using arccos_lt_bounded arccos_le_pi2
[PROOF STATE]
proof (prove)
using this:
0 \<le> a
a < 1
\<lbrakk>- 1 < ?y; ?y < 1\<rbrakk> \<Longrightarrow> 0 < arccos ?y \<and> arccos ?y < pi
\<lbrakk>0 \<le> ?y; ?y \<le> 1\<rbrakk> \<Longrightarrow> arccos ?y \<le> pi / 2

goal (1 subgoal):
 1. 0 < arccos a &&& arccos a \<le> pi / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < arccos a
arccos a \<le> pi / 2

goal (1 subgoal):
 1. \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
proof (cases "\<alpha> - arccos a \<ge> - pi/2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. - pi / 2 \<le> \<alpha> - arccos a \<Longrightarrow> \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
 2. \<not> - pi / 2 \<le> \<alpha> - arccos a \<Longrightarrow> \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
- pi / 2 \<le> \<alpha> - arccos a

goal (2 subgoals):
 1. - pi / 2 \<le> \<alpha> - arccos a \<Longrightarrow> \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
 2. \<not> - pi / 2 \<le> \<alpha> - arccos a \<Longrightarrow> \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
- pi / 2 \<le> \<alpha> - arccos a

goal (1 subgoal):
 1. \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
using assms \<open>arccos a > 0\<close> \<open>arccos a \<le> pi/2\<close>
[PROOF STATE]
proof (prove)
using this:
- pi / 2 \<le> \<alpha> - arccos a
- pi / 2 \<le> \<alpha> \<and> \<alpha> \<le> pi / 2
0 \<le> a
a < 1
0 < arccos a
arccos a \<le> pi / 2

goal (1 subgoal):
 1. \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
by (rule_tac x = "\<alpha> - arccos a" in exI) auto
[PROOF STATE]
proof (state)
this:
\<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a

goal (1 subgoal):
 1. \<not> - pi / 2 \<le> \<alpha> - arccos a \<Longrightarrow> \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> - pi / 2 \<le> \<alpha> - arccos a \<Longrightarrow> \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> - pi / 2 \<le> \<alpha> - arccos a

goal (1 subgoal):
 1. \<not> - pi / 2 \<le> \<alpha> - arccos a \<Longrightarrow> \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> - pi / 2 \<le> \<alpha> - arccos a

goal (1 subgoal):
 1. \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
using assms \<open>arccos a > 0\<close> \<open>arccos a \<le> pi/2\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> - pi / 2 \<le> \<alpha> - arccos a
- pi / 2 \<le> \<alpha> \<and> \<alpha> \<le> pi / 2
0 \<le> a
a < 1
0 < arccos a
arccos a \<le> pi / 2

goal (1 subgoal):
 1. \<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a
[PROOF STEP]
by (rule_tac x = "\<alpha> + arccos a" in exI) auto
[PROOF STATE]
proof (state)
this:
\<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>\<alpha>'\<ge>- pi / 2. \<alpha>' \<le> pi / 2 \<and> \<alpha>' \<noteq> \<alpha> \<and> cos (\<alpha> - \<alpha>') = a

goal:
No subgoals!
[PROOF STEP]
qed