[STATEMENT]
lemma card_deg_sect:
  assumes "finite X" and "X \<noteq> {}"
  shows "card (deg_sect X d) = (d + (card X - 1)) choose (card X - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (deg_sect X d) = d + (card X - 1) choose (card X - 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite X
X \<noteq> {}

goal (1 subgoal):
 1. card (deg_sect X d) = d + (card X - 1) choose (card X - 1)
[PROOF STEP]
proof (induct X arbitrary: d)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>d. {} \<noteq> {} \<Longrightarrow> card (deg_sect {} d) = d + (card {} - 1) choose (card {} - 1)
 2. \<And>x F d. \<lbrakk>finite F; x \<notin> F; \<And>d. F \<noteq> {} \<Longrightarrow> card (deg_sect F d) = d + (card F - 1) choose (card F - 1); insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> card (deg_sect (insert x F) d) = d + (card (insert x F) - 1) choose (card (insert x F) - 1)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
{} \<noteq> {}

goal (2 subgoals):
 1. \<And>d. {} \<noteq> {} \<Longrightarrow> card (deg_sect {} d) = d + (card {} - 1) choose (card {} - 1)
 2. \<And>x F d. \<lbrakk>finite F; x \<notin> F; \<And>d. F \<noteq> {} \<Longrightarrow> card (deg_sect F d) = d + (card F - 1) choose (card F - 1); insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> card (deg_sect (insert x F) d) = d + (card (insert x F) - 1) choose (card (insert x F) - 1)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
{} \<noteq> {}

goal (1 subgoal):
 1. card (deg_sect {} d) = d + (card {} - 1) choose (card {} - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (deg_sect {} d) = d + (card {} - 1) choose (card {} - 1)

goal (1 subgoal):
 1. \<And>x F d. \<lbrakk>finite F; x \<notin> F; \<And>d. F \<noteq> {} \<Longrightarrow> card (deg_sect F d) = d + (card F - 1) choose (card F - 1); insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> card (deg_sect (insert x F) d) = d + (card (insert x F) - 1) choose (card (insert x F) - 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F d. \<lbrakk>finite F; x \<notin> F; \<And>d. F \<noteq> {} \<Longrightarrow> card (deg_sect F d) = d + (card F - 1) choose (card F - 1); insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> card (deg_sect (insert x F) d) = d + (card (insert x F) - 1) choose (card (insert x F) - 1)
[PROOF STEP]
case (insert x X)
[PROOF STATE]
proof (state)
this:
finite X
x \<notin> X
X \<noteq> {} \<Longrightarrow> card (deg_sect X ?d) = ?d + (card X - 1) choose (card X - 1)
insert x X \<noteq> {}

goal (1 subgoal):
 1. \<And>x F d. \<lbrakk>finite F; x \<notin> F; \<And>d. F \<noteq> {} \<Longrightarrow> card (deg_sect F d) = d + (card F - 1) choose (card F - 1); insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> card (deg_sect (insert x F) d) = d + (card (insert x F) - 1) choose (card (insert x F) - 1)
[PROOF STEP]
from insert(1, 2)
[PROOF STATE]
proof (chain)
picking this:
finite X
x \<notin> X
[PROOF STEP]
have eq1: "card (insert x X) = Suc (card X)"
[PROOF STATE]
proof (prove)
using this:
finite X
x \<notin> X

goal (1 subgoal):
 1. card (insert x X) = Suc (card X)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (insert x X) = Suc (card X)

goal (1 subgoal):
 1. \<And>x F d. \<lbrakk>finite F; x \<notin> F; \<And>d. F \<noteq> {} \<Longrightarrow> card (deg_sect F d) = d + (card F - 1) choose (card F - 1); insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> card (deg_sect (insert x F) d) = d + (card (insert x F) - 1) choose (card (insert x F) - 1)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
proof (cases "X = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. X = {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
 2. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
X = {}

goal (2 subgoals):
 1. X = {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
 2. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
X = {}

goal (1 subgoal):
 1. card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
X \<noteq> {}

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
with insert.hyps(1)
[PROOF STATE]
proof (chain)
picking this:
finite X
X \<noteq> {}
[PROOF STEP]
have "0 < card X"
[PROOF STATE]
proof (prove)
using this:
finite X
X \<noteq> {}

goal (1 subgoal):
 1. 0 < card X
[PROOF STEP]
by (simp add: card_gt_0_iff)
[PROOF STATE]
proof (state)
this:
0 < card X

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
let ?f = "\<lambda>d0. Poly_Mapping.single x (d - d0)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
X \<noteq> {}
[PROOF STEP]
have eq2: "card (deg_sect X d0) = d0 + (card X - 1) choose (card X - 1)" for d0
[PROOF STATE]
proof (prove)
using this:
X \<noteq> {}

goal (1 subgoal):
 1. card (deg_sect X d0) = d0 + (card X - 1) choose (card X - 1)
[PROOF STEP]
by (rule insert.hyps)
[PROOF STATE]
proof (state)
this:
card (deg_sect X ?d0.0) = ?d0.0 + (card X - 1) choose (card X - 1)

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
have "finite {..d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {..d}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {..d}

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {..d}

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
from insert.hyps(1)
[PROOF STATE]
proof (chain)
picking this:
finite X
[PROOF STEP]
have "\<forall>d0\<in>{..d}. finite ((+) (?f d0) ` deg_sect X d0)"
[PROOF STATE]
proof (prove)
using this:
finite X

goal (1 subgoal):
 1. \<forall>d0\<in>{..d}. finite ((+) (monomial (d - d0) x) ` deg_sect X d0)
[PROOF STEP]
by (simp add: finite_deg_sect)
[PROOF STATE]
proof (state)
this:
\<forall>d0\<in>{..d}. finite ((+) (monomial (d - d0) x) ` deg_sect X d0)

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>d0\<in>{..d}. finite ((+) (monomial (d - d0) x) ` deg_sect X d0)

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
have "\<forall>d0\<in>{..d}. \<forall>d1\<in>{..d}. d0 \<noteq> d1 \<longrightarrow>
                          ((+) (?f d0) ` deg_sect X d0) \<inter> ((+) (?f d1) ` deg_sect X d1) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>d0\<in>{..d}. \<forall>d1\<in>{..d}. d0 \<noteq> d1 \<longrightarrow> (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 = {}
[PROOF STEP]
proof (intro ballI impI, rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix d1 d2 :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "d1 \<noteq> d2"
[PROOF STATE]
proof (state)
this:
d1 \<noteq> d2

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "((+) (?f d1) ` deg_sect X d1) \<inter> ((+) (?f d2) ` deg_sect X d2) \<noteq> {}"
[PROOF STATE]
proof (state)
this:
(+) (monomial (d - d1) x) ` deg_sect X d1 \<inter> (+) (monomial (d - d2) x) ` deg_sect X d2 \<noteq> {}

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(+) (monomial (d - d1) x) ` deg_sect X d1 \<inter> (+) (monomial (d - d2) x) ` deg_sect X d2 \<noteq> {}
[PROOF STEP]
obtain t where "t \<in> ((+) (?f d1) ` deg_sect X d1) \<inter> ((+) (?f d2) ` deg_sect X d2)"
[PROOF STATE]
proof (prove)
using this:
(+) (monomial (d - d1) x) ` deg_sect X d1 \<inter> (+) (monomial (d - d2) x) ` deg_sect X d2 \<noteq> {}

goal (1 subgoal):
 1. (\<And>t. t \<in> (+) (monomial (d - d1) x) ` deg_sect X d1 \<inter> (+) (monomial (d - d2) x) ` deg_sect X d2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
t \<in> (+) (monomial (d - d1) x) ` deg_sect X d1 \<inter> (+) (monomial (d - d2) x) ` deg_sect X d2

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence t1: "t \<in> (+) (?f d1) ` deg_sect X d1" and t2: "t \<in> (+) (?f d2) ` deg_sect X d2"
[PROOF STATE]
proof (prove)
using this:
t \<in> (+) (monomial (d - d1) x) ` deg_sect X d1 \<inter> (+) (monomial (d - d2) x) ` deg_sect X d2

goal (1 subgoal):
 1. t \<in> (+) (monomial (d - d1) x) ` deg_sect X d1 &&& t \<in> (+) (monomial (d - d2) x) ` deg_sect X d2
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
t \<in> (+) (monomial (d - d1) x) ` deg_sect X d1
t \<in> (+) (monomial (d - d2) x) ` deg_sect X d2

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from t1
[PROOF STATE]
proof (chain)
picking this:
t \<in> (+) (monomial (d - d1) x) ` deg_sect X d1
[PROOF STEP]
obtain s1 where "s1 \<in> deg_sect X d1" and s1: "t = ?f d1 + s1"
[PROOF STATE]
proof (prove)
using this:
t \<in> (+) (monomial (d - d1) x) ` deg_sect X d1

goal (1 subgoal):
 1. (\<And>s1. \<lbrakk>s1 \<in> deg_sect X d1; t = monomial (d - d1) x + s1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
s1 \<in> deg_sect X d1
t = monomial (d - d1) x + s1

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from this(1)
[PROOF STATE]
proof (chain)
picking this:
s1 \<in> deg_sect X d1
[PROOF STEP]
have "s1 \<in> .[X]"
[PROOF STATE]
proof (prove)
using this:
s1 \<in> deg_sect X d1

goal (1 subgoal):
 1. s1 \<in> .[X]
[PROOF STEP]
by (rule deg_sectD)
[PROOF STATE]
proof (state)
this:
s1 \<in> .[X]

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "keys s1 \<subseteq> X"
[PROOF STATE]
proof (prove)
using this:
s1 \<in> .[X]

goal (1 subgoal):
 1. keys s1 \<subseteq> X
[PROOF STEP]
by (rule PPsD)
[PROOF STATE]
proof (state)
this:
keys s1 \<subseteq> X

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with insert.hyps(2)
[PROOF STATE]
proof (chain)
picking this:
x \<notin> X
keys s1 \<subseteq> X
[PROOF STEP]
have eq3: "lookup s1 x = 0"
[PROOF STATE]
proof (prove)
using this:
x \<notin> X
keys s1 \<subseteq> X

goal (1 subgoal):
 1. lookup s1 x = 0
[PROOF STEP]
by (auto simp: in_keys_iff)
[PROOF STATE]
proof (state)
this:
lookup s1 x = 0

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from t2
[PROOF STATE]
proof (chain)
picking this:
t \<in> (+) (monomial (d - d2) x) ` deg_sect X d2
[PROOF STEP]
obtain s2 where "s2 \<in> deg_sect X d2" and s2: "t = ?f d2 + s2"
[PROOF STATE]
proof (prove)
using this:
t \<in> (+) (monomial (d - d2) x) ` deg_sect X d2

goal (1 subgoal):
 1. (\<And>s2. \<lbrakk>s2 \<in> deg_sect X d2; t = monomial (d - d2) x + s2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
s2 \<in> deg_sect X d2
t = monomial (d - d2) x + s2

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from this(1)
[PROOF STATE]
proof (chain)
picking this:
s2 \<in> deg_sect X d2
[PROOF STEP]
have "s2 \<in> .[X]"
[PROOF STATE]
proof (prove)
using this:
s2 \<in> deg_sect X d2

goal (1 subgoal):
 1. s2 \<in> .[X]
[PROOF STEP]
by (rule deg_sectD)
[PROOF STATE]
proof (state)
this:
s2 \<in> .[X]

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "keys s2 \<subseteq> X"
[PROOF STATE]
proof (prove)
using this:
s2 \<in> .[X]

goal (1 subgoal):
 1. keys s2 \<subseteq> X
[PROOF STEP]
by (rule PPsD)
[PROOF STATE]
proof (state)
this:
keys s2 \<subseteq> X

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with insert.hyps(2)
[PROOF STATE]
proof (chain)
picking this:
x \<notin> X
keys s2 \<subseteq> X
[PROOF STEP]
have eq4: "lookup s2 x = 0"
[PROOF STATE]
proof (prove)
using this:
x \<notin> X
keys s2 \<subseteq> X

goal (1 subgoal):
 1. lookup s2 x = 0
[PROOF STEP]
by (auto simp: in_keys_iff)
[PROOF STATE]
proof (state)
this:
lookup s2 x = 0

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from s2
[PROOF STATE]
proof (chain)
picking this:
t = monomial (d - d2) x + s2
[PROOF STEP]
have "lookup (?f d1 + s1) x = lookup (?f d2 + s2) x"
[PROOF STATE]
proof (prove)
using this:
t = monomial (d - d2) x + s2

goal (1 subgoal):
 1. lookup (monomial (d - d1) x + s1) x = lookup (monomial (d - d2) x + s2) x
[PROOF STEP]
by (simp only: s1)
[PROOF STATE]
proof (state)
this:
lookup (monomial (d - d1) x + s1) x = lookup (monomial (d - d2) x + s2) x

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "d - d1 = d - d2"
[PROOF STATE]
proof (prove)
using this:
lookup (monomial (d - d1) x + s1) x = lookup (monomial (d - d2) x + s2) x

goal (1 subgoal):
 1. d - d1 = d - d2
[PROOF STEP]
by (simp add: lookup_add eq3 eq4)
[PROOF STATE]
proof (state)
this:
d - d1 = d - d2

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
d - d1 = d - d2

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "d1 \<in> {..d}" and "d2 \<in> {..d}"
[PROOF STATE]
proof (state)
this:
d1 \<in> {..d}
d2 \<in> {..d}

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
d - d1 = d - d2
d1 \<in> {..d}
d2 \<in> {..d}
[PROOF STEP]
have "d1 = d2"
[PROOF STATE]
proof (prove)
using this:
d - d1 = d - d2
d1 \<in> {..d}
d2 \<in> {..d}

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

goal (1 subgoal):
 1. \<And>d0 d1. \<lbrakk>d0 \<in> {..d}; d1 \<in> {..d}; d0 \<noteq> d1; (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with \<open>d1 \<noteq> d2\<close>
[PROOF STATE]
proof (chain)
picking this:
d1 \<noteq> d2
d1 = d2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
d1 \<noteq> d2
d1 = d2

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>d0\<in>{..d}. \<forall>d1\<in>{..d}. d0 \<noteq> d1 \<longrightarrow> (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 = {}

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {..d}
\<forall>d0\<in>{..d}. finite ((+) (monomial (d - d0) x) ` deg_sect X d0)
\<forall>d0\<in>{..d}. \<forall>d1\<in>{..d}. d0 \<noteq> d1 \<longrightarrow> (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 = {}
[PROOF STEP]
have "card (deg_sect (insert x X) d) =
                       (\<Sum>d0\<le>d. card ((+) (monomial (d - d0) x) ` deg_sect X d0))"
[PROOF STATE]
proof (prove)
using this:
finite {..d}
\<forall>d0\<in>{..d}. finite ((+) (monomial (d - d0) x) ` deg_sect X d0)
\<forall>d0\<in>{..d}. \<forall>d1\<in>{..d}. d0 \<noteq> d1 \<longrightarrow> (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 = {}

goal (1 subgoal):
 1. card (deg_sect (insert x X) d) = (\<Sum>d0\<le>d. card ((+) (monomial (d - d0) x) ` deg_sect X d0))
[PROOF STEP]
unfolding deg_sect_insert
[PROOF STATE]
proof (prove)
using this:
finite {..d}
\<forall>d0\<in>{..d}. finite ((+) (monomial (d - d0) x) ` deg_sect X d0)
\<forall>d0\<in>{..d}. \<forall>d1\<in>{..d}. d0 \<noteq> d1 \<longrightarrow> (+) (monomial (d - d0) x) ` deg_sect X d0 \<inter> (+) (monomial (d - d1) x) ` deg_sect X d1 = {}

goal (1 subgoal):
 1. card (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) = (\<Sum>d0\<le>d. card ((+) (monomial (d - d0) x) ` deg_sect X d0))
[PROOF STEP]
by (rule card_UN_disjoint)
[PROOF STATE]
proof (state)
this:
card (deg_sect (insert x X) d) = (\<Sum>d0\<le>d. card ((+) (monomial (d - d0) x) ` deg_sect X d0))

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (deg_sect (insert x X) d) = (\<Sum>d0\<le>d. card ((+) (monomial (d - d0) x) ` deg_sect X d0))

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
from refl
[PROOF STATE]
proof (chain)
picking this:
?t = ?t
[PROOF STEP]
have "... = (\<Sum>d0\<le>d. card (deg_sect X d0))"
[PROOF STATE]
proof (prove)
using this:
?t = ?t

goal (1 subgoal):
 1. (\<Sum>d0\<le>d. card ((+) (monomial (d - d0) x) ` deg_sect X d0)) = (\<Sum>d0\<le>d. card (deg_sect X d0))
[PROOF STEP]
proof (rule sum.cong)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> {..d} \<Longrightarrow> card ((+) (monomial (d - xa) x) ` deg_sect X xa) = card (deg_sect X xa)
[PROOF STEP]
fix d0
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> {..d} \<Longrightarrow> card ((+) (monomial (d - xa) x) ` deg_sect X xa) = card (deg_sect X xa)
[PROOF STEP]
have "inj_on ((+) (monomial (d - d0) x)) (deg_sect X d0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((+) (monomial (d - d0) x)) (deg_sect X d0)
[PROOF STEP]
by (rule, rule add_left_imp_eq)
[PROOF STATE]
proof (state)
this:
inj_on ((+) (monomial (d - d0) x)) (deg_sect X d0)

goal (1 subgoal):
 1. \<And>xa. xa \<in> {..d} \<Longrightarrow> card ((+) (monomial (d - xa) x) ` deg_sect X xa) = card (deg_sect X xa)
[PROOF STEP]
thus "card ((+) (monomial (d - d0) x) ` deg_sect X d0) = card (deg_sect X d0)"
[PROOF STATE]
proof (prove)
using this:
inj_on ((+) (monomial (d - d0) x)) (deg_sect X d0)

goal (1 subgoal):
 1. card ((+) (monomial (d - d0) x) ` deg_sect X d0) = card (deg_sect X d0)
[PROOF STEP]
by (rule card_image)
[PROOF STATE]
proof (state)
this:
card ((+) (monomial (d - d0) x) ` deg_sect X d0) = card (deg_sect X d0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>d0\<le>d. card ((+) (monomial (d - d0) x) ` deg_sect X d0)) = (\<Sum>d0\<le>d. card (deg_sect X d0))

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d0\<le>d. card ((+) (monomial (d - d0) x) ` deg_sect X d0)) = (\<Sum>d0\<le>d. card (deg_sect X d0))

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
have "... = (\<Sum>d0\<le>d. (card X - 1) + d0 choose (card X - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d0\<le>d. card (deg_sect X d0)) = (\<Sum>d0\<le>d. card X - 1 + d0 choose (card X - 1))
[PROOF STEP]
by (simp only: eq2 add.commute)
[PROOF STATE]
proof (state)
this:
(\<Sum>d0\<le>d. card (deg_sect X d0)) = (\<Sum>d0\<le>d. card X - 1 + d0 choose (card X - 1))

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d0\<le>d. card (deg_sect X d0)) = (\<Sum>d0\<le>d. card X - 1 + d0 choose (card X - 1))

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
have "... = (\<Sum>d0\<le>d. (card X - 1) + d0 choose d0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d0\<le>d. card X - 1 + d0 choose (card X - 1)) = (\<Sum>d0\<le>d. card X - 1 + d0 choose d0)
[PROOF STEP]
by (simp only: binomial_symmetric_plus)
[PROOF STATE]
proof (state)
this:
(\<Sum>d0\<le>d. card X - 1 + d0 choose (card X - 1)) = (\<Sum>d0\<le>d. card X - 1 + d0 choose d0)

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d0\<le>d. card X - 1 + d0 choose (card X - 1)) = (\<Sum>d0\<le>d. card X - 1 + d0 choose d0)

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
have "... = Suc ((card X - 1) + d) choose d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d0\<le>d. card X - 1 + d0 choose d0) = Suc (card X - 1 + d) choose d
[PROOF STEP]
by (rule sum_choose_lower)
[PROOF STATE]
proof (state)
this:
(\<Sum>d0\<le>d. card X - 1 + d0 choose d0) = Suc (card X - 1 + d) choose d

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d0\<le>d. card X - 1 + d0 choose d0) = Suc (card X - 1 + d) choose d

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
from \<open>0 < card X\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < card X
[PROOF STEP]
have "... = d + (card (insert x X) - 1) choose d"
[PROOF STATE]
proof (prove)
using this:
0 < card X

goal (1 subgoal):
 1. Suc (card X - 1 + d) choose d = d + (card (insert x X) - 1) choose d
[PROOF STEP]
by (simp add: eq1 add.commute)
[PROOF STATE]
proof (state)
this:
Suc (card X - 1 + d) choose d = d + (card (insert x X) - 1) choose d

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc (card X - 1 + d) choose d = d + (card (insert x X) - 1) choose d

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
have "... = d + (card (insert x X) - 1) choose (card (insert x X) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d + (card (insert x X) - 1) choose d = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
by (fact binomial_symmetric_plus)
[PROOF STATE]
proof (state)
this:
d + (card (insert x X) - 1) choose d = d + (card (insert x X) - 1) choose (card (insert x X) - 1)

goal (1 subgoal):
 1. X \<noteq> {} \<Longrightarrow> card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)

goal (1 subgoal):
 1. card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (deg_sect (insert x X) d) = d + (card (insert x X) - 1) choose (card (insert x X) - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma basis_null_space_transpose_eq_basis_left_null_space:
shows "basis_null_space (transpose A) = basis_left_null_space A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_null_space (Finite_Cartesian_Product.transpose A) = basis_left_null_space A
[PROOF STEP]
by (metis transpose_transpose basis_null_space_eq_basis_left_null_space_transpose)


[STATEMENT]
lemma sorted_wrt_rev:
  "sorted_wrt P (rev xs) = sorted_wrt (\<lambda>x y. P y x) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt P (rev xs) = sorted_wrt (\<lambda>x y. P y x) xs
[PROOF STEP]
by (induction xs) (auto simp add: sorted_wrt_append)


[STATEMENT]
lemma choose_square_sum: "(\<Sum>k\<le>n. (n choose k)^2) = ((2*n) choose n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. (n choose k)\<^sup>2) = 2 * n choose n
[PROOF STEP]
using vandermonde[of n n n]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<le>n. (n choose k) * (n choose (n - k))) = n + n choose n

goal (1 subgoal):
 1. (\<Sum>k\<le>n. (n choose k)\<^sup>2) = 2 * n choose n
[PROOF STEP]
by (simp add: power2_eq_square mult_2 binomial_symmetric [symmetric])


[STATEMENT]
lemma union_multisetsD:
  assumes "M + N \<in> multisets A"
  shows "M \<in> multisets A \<and> N \<in> multisets A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<in> multisets A \<and> N \<in> multisets A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
M + N \<in> multisets A

goal (1 subgoal):
 1. M \<in> multisets A \<and> N \<in> multisets A
[PROOF STEP]
by (auto simp: multisets_def)


[STATEMENT]
lemma cblinfun_eq_0_on_UNIV_span:
  fixes basis::\<open>'a::complex_normed_vector set\<close>
  assumes "cspan basis = UNIV"
    and "\<And>s. s\<in>basis \<Longrightarrow> F *\<^sub>V s = 0"
  shows \<open>F = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F = 0
[PROOF STEP]
by (metis cblinfun_eq_0_on_span UNIV_I assms cblinfun.zero_left cblinfun_eqI)


[STATEMENT]
lemma limseq_even_odd:
  assumes "(\<lambda>n. f (2 * n)) \<longlonglongrightarrow> (l :: 'a :: topological_space)"
      and "(\<lambda>n. f (2 * n + 1)) \<longlonglongrightarrow> l"
  shows "f \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<longlonglongrightarrow> l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. f (2 * n)) \<longlonglongrightarrow> l
(\<lambda>n. f (2 * n + 1)) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. f \<longlonglongrightarrow> l
[PROOF STEP]
by (auto simp: filterlim_iff intro: sequentially_even_odd)


[STATEMENT]
lemma ennreal_add_partial_function_mono [partial_function_mono]:
  "\<lbrakk> monotone (fun_ord (\<le>)) (\<le>) f; monotone (fun_ord (\<le>)) (\<le>) g \<rbrakk>
  \<Longrightarrow> monotone (fun_ord (\<le>)) (\<le>) (\<lambda>x. f x + g x :: ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>monotone (fun_ord (\<le>)) (\<le>) f; monotone (fun_ord (\<le>)) (\<le>) g\<rbrakk> \<Longrightarrow> monotone (fun_ord (\<le>)) (\<le>) (\<lambda>x. f x + g x)
[PROOF STEP]
by(rule mono2mono_ennreal_add)


[STATEMENT]
lemma rbt_rel_sv[relator_props]:
  assumes SK: "single_valued Rk"
  assumes SV: "single_valued Rv"
  shows "single_valued (\<langle>Rk, Rv\<rangle>rbt_rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_valued (\<langle>Rk, Rv\<rangle>rbt_rel)
[PROOF STEP]
by (auto intro: single_valuedI rbt_rel_sv_aux[OF SK SV])


[STATEMENT]
lemma transpose_knights_path':
  assumes "knights_path b ps"
  shows "knights_path (transpose_board b) (transpose ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. knights_path (transpose_board b) (KnightsTour.transpose ps)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
knights_path b ps

goal (1 subgoal):
 1. knights_path (transpose_board b) (KnightsTour.transpose ps)
[PROOF STEP]
proof (induction rule: knights_path.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>s\<^sub>i. knights_path (transpose_board {s\<^sub>i}) (KnightsTour.transpose [s\<^sub>i])
 2. \<And>s\<^sub>i b s\<^sub>j ps. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))\<rbrakk> \<Longrightarrow> knights_path (transpose_board (b \<union> {s\<^sub>i})) (KnightsTour.transpose (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
case (1 s\<^sub>i)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>s\<^sub>i. knights_path (transpose_board {s\<^sub>i}) (KnightsTour.transpose [s\<^sub>i])
 2. \<And>s\<^sub>i b s\<^sub>j ps. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))\<rbrakk> \<Longrightarrow> knights_path (transpose_board (b \<union> {s\<^sub>i})) (KnightsTour.transpose (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
have "transpose_board {s\<^sub>i} = {transpose_square s\<^sub>i}" "transpose [s\<^sub>i] = [transpose_square s\<^sub>i]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose_board {s\<^sub>i} = {transpose_square s\<^sub>i} &&& KnightsTour.transpose [s\<^sub>i] = [transpose_square s\<^sub>i]
[PROOF STEP]
using transpose_board_correct
[PROOF STATE]
proof (prove)
using this:
(?s\<^sub>i \<in> ?b) = (transpose_square ?s\<^sub>i \<in> transpose_board ?b)

goal (1 subgoal):
 1. transpose_board {s\<^sub>i} = {transpose_square s\<^sub>i} &&& KnightsTour.transpose [s\<^sub>i] = [transpose_square s\<^sub>i]
[PROOF STEP]
by (auto simp: transpose_square_def split: prod.splits)
[PROOF STATE]
proof (state)
this:
transpose_board {s\<^sub>i} = {transpose_square s\<^sub>i}
KnightsTour.transpose [s\<^sub>i] = [transpose_square s\<^sub>i]

goal (2 subgoals):
 1. \<And>s\<^sub>i. knights_path (transpose_board {s\<^sub>i}) (KnightsTour.transpose [s\<^sub>i])
 2. \<And>s\<^sub>i b s\<^sub>j ps. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))\<rbrakk> \<Longrightarrow> knights_path (transpose_board (b \<union> {s\<^sub>i})) (KnightsTour.transpose (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
transpose_board {s\<^sub>i} = {transpose_square s\<^sub>i}
KnightsTour.transpose [s\<^sub>i] = [transpose_square s\<^sub>i]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
transpose_board {s\<^sub>i} = {transpose_square s\<^sub>i}
KnightsTour.transpose [s\<^sub>i] = [transpose_square s\<^sub>i]

goal (1 subgoal):
 1. knights_path (transpose_board {s\<^sub>i}) (KnightsTour.transpose [s\<^sub>i])
[PROOF STEP]
by (auto intro: knights_path.intros)
[PROOF STATE]
proof (state)
this:
knights_path (transpose_board {s\<^sub>i}) (KnightsTour.transpose [s\<^sub>i])

goal (1 subgoal):
 1. \<And>s\<^sub>i b s\<^sub>j ps. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))\<rbrakk> \<Longrightarrow> knights_path (transpose_board (b \<union> {s\<^sub>i})) (KnightsTour.transpose (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s\<^sub>i b s\<^sub>j ps. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))\<rbrakk> \<Longrightarrow> knights_path (transpose_board (b \<union> {s\<^sub>i})) (KnightsTour.transpose (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
case (2 s\<^sub>i b s\<^sub>j ps)
[PROOF STATE]
proof (state)
this:
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))

goal (1 subgoal):
 1. \<And>s\<^sub>i b s\<^sub>j ps. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))\<rbrakk> \<Longrightarrow> knights_path (transpose_board (b \<union> {s\<^sub>i})) (KnightsTour.transpose (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))
[PROOF STEP]
have prems: "transpose_square s\<^sub>i \<notin> transpose_board b"
            "valid_step (transpose_square s\<^sub>i) (transpose_square s\<^sub>j)"
            and "transpose (s\<^sub>j#ps) = transpose_square s\<^sub>j#transpose ps"
[PROOF STATE]
proof (prove)
using this:
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))

goal (1 subgoal):
 1. (transpose_square s\<^sub>i \<notin> transpose_board b &&& valid_step (transpose_square s\<^sub>i) (transpose_square s\<^sub>j)) &&& KnightsTour.transpose (s\<^sub>j # ps) = transpose_square s\<^sub>j # KnightsTour.transpose ps
[PROOF STEP]
using 2 transpose_board_correct transpose_valid_step
[PROOF STATE]
proof (prove)
using this:
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))
(?s\<^sub>i \<in> ?b) = (transpose_square ?s\<^sub>i \<in> transpose_board ?b)
valid_step ?s\<^sub>i ?s\<^sub>j = valid_step (transpose_square ?s\<^sub>i) (transpose_square ?s\<^sub>j)

goal (1 subgoal):
 1. (transpose_square s\<^sub>i \<notin> transpose_board b &&& valid_step (transpose_square s\<^sub>i) (transpose_square s\<^sub>j)) &&& KnightsTour.transpose (s\<^sub>j # ps) = transpose_square s\<^sub>j # KnightsTour.transpose ps
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
transpose_square s\<^sub>i \<notin> transpose_board b
valid_step (transpose_square s\<^sub>i) (transpose_square s\<^sub>j)
KnightsTour.transpose (s\<^sub>j # ps) = transpose_square s\<^sub>j # KnightsTour.transpose ps

goal (1 subgoal):
 1. \<And>s\<^sub>i b s\<^sub>j ps. \<lbrakk>s\<^sub>i \<notin> b; valid_step s\<^sub>i s\<^sub>j; knights_path b (s\<^sub>j # ps); knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))\<rbrakk> \<Longrightarrow> knights_path (transpose_board (b \<union> {s\<^sub>i})) (KnightsTour.transpose (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
transpose_square s\<^sub>i \<notin> transpose_board b
valid_step (transpose_square s\<^sub>i) (transpose_square s\<^sub>j)
KnightsTour.transpose (s\<^sub>j # ps) = transpose_square s\<^sub>j # KnightsTour.transpose ps
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
transpose_square s\<^sub>i \<notin> transpose_board b
valid_step (transpose_square s\<^sub>i) (transpose_square s\<^sub>j)
KnightsTour.transpose (s\<^sub>j # ps) = transpose_square s\<^sub>j # KnightsTour.transpose ps

goal (1 subgoal):
 1. knights_path (transpose_board (b \<union> {s\<^sub>i})) (KnightsTour.transpose (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
using 2 knights_path.intros(2)[OF prems] insert_transpose_board
[PROOF STATE]
proof (prove)
using this:
transpose_square s\<^sub>i \<notin> transpose_board b
valid_step (transpose_square s\<^sub>i) (transpose_square s\<^sub>j)
KnightsTour.transpose (s\<^sub>j # ps) = transpose_square s\<^sub>j # KnightsTour.transpose ps
s\<^sub>i \<notin> b
valid_step s\<^sub>i s\<^sub>j
knights_path b (s\<^sub>j # ps)
knights_path (transpose_board b) (KnightsTour.transpose (s\<^sub>j # ps))
knights_path (transpose_board b) (transpose_square s\<^sub>j # ?ps) \<Longrightarrow> knights_path (transpose_board b \<union> {transpose_square s\<^sub>i}) (transpose_square s\<^sub>i # transpose_square s\<^sub>j # ?ps)
insert (transpose_square ?s\<^sub>i) (transpose_board ?b) = transpose_board (insert ?s\<^sub>i ?b)

goal (1 subgoal):
 1. knights_path (transpose_board (b \<union> {s\<^sub>i})) (KnightsTour.transpose (s\<^sub>i # s\<^sub>j # ps))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
knights_path (transpose_board (b \<union> {s\<^sub>i})) (KnightsTour.transpose (s\<^sub>i # s\<^sub>j # ps))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lead_monom_sum_le: "(\<And>x. x \<in> X \<Longrightarrow> lead_monom (h x) \<le> ub) \<Longrightarrow> lead_monom (sum h X) \<le> ub"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> X \<Longrightarrow> lead_monom (h x) \<le> ub) \<Longrightarrow> lead_monom (sum h X) \<le> ub
[PROOF STEP]
by (induction X rule: infinite_finite_induct) (auto intro!: order.trans[OF lead_monom_add])


[STATEMENT]
lemma ne_diagonal_fib: "(\<Sum>k = 0..n. (n-k) choose k) = fib (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)
[PROOF STEP]
proof (induct n rule: fib.induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<Sum>k = 0..0. 0 - k choose k) = fib (Suc 0)
 2. (\<Sum>k = 0..Suc 0. Suc 0 - k choose k) = fib (Suc (Suc 0))
 3. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. (\<Sum>k = 0..0. 0 - k choose k) = fib (Suc 0)
 2. (\<Sum>k = 0..Suc 0. Suc 0 - k choose k) = fib (Suc (Suc 0))
 3. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..0. 0 - k choose k) = fib (Suc 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..0. 0 - k choose k) = fib (Suc 0)

goal (2 subgoals):
 1. (\<Sum>k = 0..Suc 0. Suc 0 - k choose k) = fib (Suc (Suc 0))
 2. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Sum>k = 0..Suc 0. Suc 0 - k choose k) = fib (Suc (Suc 0))
 2. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<Sum>k = 0..Suc 0. Suc 0 - k choose k) = fib (Suc (Suc 0))
 2. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..Suc 0. Suc 0 - k choose k) = fib (Suc (Suc 0))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..Suc 0. Suc 0 - k choose k) = fib (Suc (Suc 0))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
case (3 n)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n))
(\<Sum>k = 0..n. n - k choose k) = fib (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
have "(\<Sum>k = 0..Suc n. Suc (Suc n) - k choose k) =
     (\<Sum>k = 0..Suc n. (Suc n - k choose k) + (if k = 0 then 0 else (Suc n - k choose (k - 1))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..Suc n. Suc (Suc n) - k choose k) = (\<Sum>k = 0..Suc n. Suc n - k choose k + (if k = 0 then 0 else Suc n - k choose (k - 1)))
[PROOF STEP]
by (rule sum.cong) (simp_all add: choose_reduce_nat)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..Suc n. Suc (Suc n) - k choose k) = (\<Sum>k = 0..Suc n. Suc n - k choose k + (if k = 0 then 0 else Suc n - k choose (k - 1)))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..Suc n. Suc (Suc n) - k choose k) = (\<Sum>k = 0..Suc n. Suc n - k choose k + (if k = 0 then 0 else Suc n - k choose (k - 1)))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
have "\<dots> =
    (\<Sum>k = 0..Suc n. Suc n - k choose k) +
    (\<Sum>k = 0..Suc n. if k=0 then 0 else (Suc n - k choose (k - 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..Suc n. Suc n - k choose k + (if k = 0 then 0 else Suc n - k choose (k - 1))) = (\<Sum>k = 0..Suc n. Suc n - k choose k) + (\<Sum>k = 0..Suc n. if k = 0 then 0 else Suc n - k choose (k - 1))
[PROOF STEP]
by (simp add: sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..Suc n. Suc n - k choose k + (if k = 0 then 0 else Suc n - k choose (k - 1))) = (\<Sum>k = 0..Suc n. Suc n - k choose k) + (\<Sum>k = 0..Suc n. if k = 0 then 0 else Suc n - k choose (k - 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..Suc n. Suc n - k choose k + (if k = 0 then 0 else Suc n - k choose (k - 1))) = (\<Sum>k = 0..Suc n. Suc n - k choose k) + (\<Sum>k = 0..Suc n. if k = 0 then 0 else Suc n - k choose (k - 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
have "\<dots> = (\<Sum>k = 0..Suc n. Suc n - k choose k) + (\<Sum>j = 0..n. n - j choose j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..Suc n. Suc n - k choose k) + (\<Sum>k = 0..Suc n. if k = 0 then 0 else Suc n - k choose (k - 1)) = (\<Sum>k = 0..Suc n. Suc n - k choose k) + (\<Sum>j = 0..n. n - j choose j)
[PROOF STEP]
by (metis sum_choose_drop_zero)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..Suc n. Suc n - k choose k) + (\<Sum>k = 0..Suc n. if k = 0 then 0 else Suc n - k choose (k - 1)) = (\<Sum>k = 0..Suc n. Suc n - k choose k) + (\<Sum>j = 0..n. n - j choose j)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n)); (\<Sum>k = 0..n. n - k choose k) = fib (Suc n)\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k = 0..Suc n. Suc (Suc n) - k choose k) = (\<Sum>k = 0..Suc n. Suc n - k choose k) + (\<Sum>j = 0..n. n - j choose j)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 0..Suc n. Suc (Suc n) - k choose k) = (\<Sum>k = 0..Suc n. Suc n - k choose k) + (\<Sum>j = 0..n. n - j choose j)

goal (1 subgoal):
 1. (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 0..Suc n. Suc (Suc n) - k choose k) = (\<Sum>k = 0..Suc n. Suc n - k choose k) + (\<Sum>j = 0..n. n - j choose j)
(\<Sum>k = 0..Suc n. Suc n - k choose k) = fib (Suc (Suc n))
(\<Sum>k = 0..n. n - k choose k) = fib (Suc n)

goal (1 subgoal):
 1. (\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..Suc (Suc n). Suc (Suc n) - k choose k) = fib (Suc (Suc (Suc n)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_lifting_map:
  fixes f :: "'a :: multiseries \<Rightarrow> 'b :: multiseries"
    and F :: "'a ms"
  assumes "is_lifting f basis basis'"
  assumes "length basis' = expansion_level TYPE('b)"
  shows   "is_lifting (map_ms f) (b # basis) (b # basis')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_lifting (map_ms f) (b # basis) (b # basis')
[PROOF STEP]
unfolding is_lifting_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>C. eval (map_ms f C) = eval C \<and> (is_expansion C (b # basis) \<longrightarrow> is_expansion (map_ms f C) (b # basis')) \<and> trimmed (map_ms f C) = trimmed C \<and> fst (dominant_term (map_ms f C)) = fst (dominant_term C)
[PROOF STEP]
by (intro allI conjI impI is_expansion_map_final[OF assms(1)])
     (insert assms, simp_all add: is_lifting_def fst_dominant_term_map_ms[OF assms(1)]
        trimmed_map_ms[OF assms(1)])


[STATEMENT]
lemma cltn2_abs_mult:
  assumes "k \<noteq> 0" and "invertible A"
  shows "cltn2_abs (k *\<^sub>R A) = cltn2_abs A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cltn2_abs (k *\<^sub>R A) = cltn2_abs A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cltn2_abs (k *\<^sub>R A) = cltn2_abs A
[PROOF STEP]
from \<open>k \<noteq> 0\<close> and \<open>invertible A\<close> and scalar_invertible
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 0
invertible A
\<lbrakk>?k \<noteq> 0; invertible ?A\<rbrakk> \<Longrightarrow> invertible (?k *\<^sub>R ?A)
[PROOF STEP]
have "invertible (k *\<^sub>R A)"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
invertible A
\<lbrakk>?k \<noteq> 0; invertible ?A\<rbrakk> \<Longrightarrow> invertible (?k *\<^sub>R ?A)

goal (1 subgoal):
 1. invertible (k *\<^sub>R A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
invertible (k *\<^sub>R A)

goal (1 subgoal):
 1. cltn2_abs (k *\<^sub>R A) = cltn2_abs A
[PROOF STEP]
with \<open>invertible A\<close>
[PROOF STATE]
proof (chain)
picking this:
invertible A
invertible (k *\<^sub>R A)
[PROOF STEP]
have "(k *\<^sub>R A, A) \<in> invertible_proportionality"
[PROOF STATE]
proof (prove)
using this:
invertible A
invertible (k *\<^sub>R A)

goal (1 subgoal):
 1. (k *\<^sub>R A, A) \<in> invertible_proportionality
[PROOF STEP]
unfolding invertible_proportionality_def
      and real_vector.proportionality_def
[PROOF STATE]
proof (prove)
using this:
invertible A
invertible (k *\<^sub>R A)

goal (1 subgoal):
 1. (k *\<^sub>R A, A) \<in> Restr {(x, y). x \<noteq> 0 \<and> y \<noteq> 0 \<and> (\<exists>k. x = k *\<^sub>R y)} (Collect invertible)
[PROOF STEP]
by (auto simp add: zero_not_invertible)
[PROOF STATE]
proof (state)
this:
(k *\<^sub>R A, A) \<in> invertible_proportionality

goal (1 subgoal):
 1. cltn2_abs (k *\<^sub>R A) = cltn2_abs A
[PROOF STEP]
with eq_equiv_class_iff
  [of "Collect invertible" invertible_proportionality "k *\<^sub>R A" A]
    and invertible_proportionality_equiv
    and \<open>invertible A\<close> and \<open>invertible (k *\<^sub>R A)\<close>
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>equiv (Collect invertible) invertible_proportionality; k *\<^sub>R A \<in> Collect invertible; A \<in> Collect invertible\<rbrakk> \<Longrightarrow> (invertible_proportionality `` {k *\<^sub>R A} = invertible_proportionality `` {A}) = ((k *\<^sub>R A, A) \<in> invertible_proportionality)
equiv (Collect invertible) invertible_proportionality
invertible A
invertible (k *\<^sub>R A)
(k *\<^sub>R A, A) \<in> invertible_proportionality
[PROOF STEP]
have "invertible_proportionality `` {k *\<^sub>R A}
    = invertible_proportionality `` {A}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>equiv (Collect invertible) invertible_proportionality; k *\<^sub>R A \<in> Collect invertible; A \<in> Collect invertible\<rbrakk> \<Longrightarrow> (invertible_proportionality `` {k *\<^sub>R A} = invertible_proportionality `` {A}) = ((k *\<^sub>R A, A) \<in> invertible_proportionality)
equiv (Collect invertible) invertible_proportionality
invertible A
invertible (k *\<^sub>R A)
(k *\<^sub>R A, A) \<in> invertible_proportionality

goal (1 subgoal):
 1. invertible_proportionality `` {k *\<^sub>R A} = invertible_proportionality `` {A}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
invertible_proportionality `` {k *\<^sub>R A} = invertible_proportionality `` {A}

goal (1 subgoal):
 1. cltn2_abs (k *\<^sub>R A) = cltn2_abs A
[PROOF STEP]
thus "cltn2_abs (k *\<^sub>R A) = cltn2_abs A"
[PROOF STATE]
proof (prove)
using this:
invertible_proportionality `` {k *\<^sub>R A} = invertible_proportionality `` {A}

goal (1 subgoal):
 1. cltn2_abs (k *\<^sub>R A) = cltn2_abs A
[PROOF STEP]
unfolding cltn2_abs_def
[PROOF STATE]
proof (prove)
using this:
invertible_proportionality `` {k *\<^sub>R A} = invertible_proportionality `` {A}

goal (1 subgoal):
 1. Abs_cltn2 (invertible_proportionality `` {k *\<^sub>R A}) = Abs_cltn2 (invertible_proportionality `` {A})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cltn2_abs (k *\<^sub>R A) = cltn2_abs A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma floor_of_nat [simp]: "\<lfloor>of_nat n\<rfloor> = int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>of_nat n\<rfloor> = int n
[PROOF STEP]
using floor_of_int [of "of_nat n"]
[PROOF STATE]
proof (prove)
using this:
\<lfloor>of_int (int n)\<rfloor> = int n

goal (1 subgoal):
 1. \<lfloor>of_nat n\<rfloor> = int n
[PROOF STEP]
by simp


[STATEMENT]
lemma (in weak_lower_semilattice) weak_meet_assoc:
  assumes L: "x \<in> carrier L"  "y \<in> carrier L"  "z \<in> carrier L"
  shows "(x \<sqinter> y) \<sqinter> z .= x \<sqinter> (y \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
have "(x \<sqinter> y) \<sqinter> z = z \<sqinter> (x \<sqinter> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z = z \<sqinter> (x \<sqinter> y)
[PROOF STEP]
by (simp only: meet_comm)
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqinter> z = z \<sqinter> (x \<sqinter> y)

goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqinter> z = z \<sqinter> (x \<sqinter> y)

goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
from L
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L
[PROOF STEP]
have "... .= \<Sqinter> {z, x, y}"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L

goal (1 subgoal):
 1. z \<sqinter> (x \<sqinter> y) .= \<Sqinter>{z, x, y}
[PROOF STEP]
by (simp add: weak_meet_assoc_lemma)
[PROOF STATE]
proof (state)
this:
z \<sqinter> (x \<sqinter> y) .= \<Sqinter>{z, x, y}

goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z \<sqinter> (x \<sqinter> y) .= \<Sqinter>{z, x, y}

goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
from L
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L
[PROOF STEP]
have "... = \<Sqinter> {x, y, z}"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L

goal (1 subgoal):
 1. \<Sqinter>{z, x, y} = \<Sqinter>{x, y, z}
[PROOF STEP]
by (simp add: insert_commute)
[PROOF STATE]
proof (state)
this:
\<Sqinter>{z, x, y} = \<Sqinter>{x, y, z}

goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sqinter>{z, x, y} = \<Sqinter>{x, y, z}

goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
from L
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L
[PROOF STEP]
have "... .= x \<sqinter> (y \<sqinter> z)"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L

goal (1 subgoal):
 1. \<Sqinter>{x, y, z} .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
by (simp add: weak_meet_assoc_lemma [symmetric])
[PROOF STATE]
proof (state)
this:
\<Sqinter>{x, y, z} .= x \<sqinter> (y \<sqinter> z)

goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x \<sqinter> y \<sqinter> z \<in> carrier L; \<Sqinter>{x, y, z} \<in> carrier L; x \<sqinter> (y \<sqinter> z) \<in> carrier L\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<sqinter> y \<sqinter> z \<in> carrier L; \<Sqinter>{x, y, z} \<in> carrier L; x \<sqinter> (y \<sqinter> z) \<in> carrier L\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)

goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
by (simp add: L)
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqinter> z .= x \<sqinter> (y \<sqinter> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in product_sigma_finite) sigma_finite:
  assumes "finite I"
  shows "sigma_finite_measure (PiM I M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_finite_measure (Pi\<^sub>M I M)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A. countable A \<and> A \<subseteq> sets (Pi\<^sub>M I M) \<and> \<Union> A = space (Pi\<^sub>M I M) \<and> (\<forall>a\<in>A. emeasure (Pi\<^sub>M I M) a \<noteq> \<infinity>)
[PROOF STEP]
interpret finite_product_sigma_finite M I
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_product_sigma_finite M I
[PROOF STEP]
by standard fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A. countable A \<and> A \<subseteq> sets (Pi\<^sub>M I M) \<and> \<Union> A = space (Pi\<^sub>M I M) \<and> (\<forall>a\<in>A. emeasure (Pi\<^sub>M I M) a \<noteq> \<infinity>)
[PROOF STEP]
obtain F where F: "\<And>j. countable (F j)" "\<And>j f. f \<in> F j \<Longrightarrow> f \<in> sets (M j)"
    "\<And>j f. f \<in> F j \<Longrightarrow> emeasure (M j) f \<noteq> \<infinity>" and
    in_space: "\<And>j. space (M j) = \<Union>(F j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>F. \<lbrakk>\<And>j. countable (F j); \<And>j f. f \<in> F j \<Longrightarrow> f \<in> sets (M j); \<And>j f. f \<in> F j \<Longrightarrow> emeasure (M j) f \<noteq> \<infinity>; \<And>j. space (M j) = \<Union> (F j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using sigma_finite_countable
[PROOF STATE]
proof (prove)
using this:
\<exists>A. countable A \<and> A \<subseteq> sets (M ?i) \<and> \<Union> A = space (M ?i) \<and> (\<forall>a\<in>A. emeasure (M ?i) a \<noteq> \<infinity>)

goal (1 subgoal):
 1. (\<And>F. \<lbrakk>\<And>j. countable (F j); \<And>j f. f \<in> F j \<Longrightarrow> f \<in> sets (M j); \<And>j f. f \<in> F j \<Longrightarrow> emeasure (M j) f \<noteq> \<infinity>; \<And>j. space (M j) = \<Union> (F j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis subset_eq)
[PROOF STATE]
proof (state)
this:
countable (F ?j)
?f \<in> F ?j \<Longrightarrow> ?f \<in> sets (M ?j)
?f \<in> F ?j \<Longrightarrow> emeasure (M ?j) ?f \<noteq> \<infinity>
space (M ?j) = \<Union> (F ?j)

goal (1 subgoal):
 1. \<exists>A. countable A \<and> A \<subseteq> sets (Pi\<^sub>M I M) \<and> \<Union> A = space (Pi\<^sub>M I M) \<and> (\<forall>a\<in>A. emeasure (Pi\<^sub>M I M) a \<noteq> \<infinity>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
countable (F ?j)
?f \<in> F ?j \<Longrightarrow> ?f \<in> sets (M ?j)
?f \<in> F ?j \<Longrightarrow> emeasure (M ?j) ?f \<noteq> \<infinity>
space (M ?j) = \<Union> (F ?j)

goal (1 subgoal):
 1. \<exists>A. countable A \<and> A \<subseteq> sets (Pi\<^sub>M I M) \<and> \<Union> A = space (Pi\<^sub>M I M) \<and> (\<forall>a\<in>A. emeasure (Pi\<^sub>M I M) a \<noteq> \<infinity>)
[PROOF STEP]
have "(\<Union>(Pi\<^sub>E I ` Pi\<^sub>E I F)) = space (Pi\<^sub>M I M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (Pi\<^sub>E I ` Pi\<^sub>E I F) = space (Pi\<^sub>M I M)
[PROOF STEP]
using in_space
[PROOF STATE]
proof (prove)
using this:
space (M ?j) = \<Union> (F ?j)

goal (1 subgoal):
 1. \<Union> (Pi\<^sub>E I ` Pi\<^sub>E I F) = space (Pi\<^sub>M I M)
[PROOF STEP]
by (auto simp: space_PiM PiE_iff intro!: PiE_choice[THEN iffD2])
[PROOF STATE]
proof (state)
this:
\<Union> (Pi\<^sub>E I ` Pi\<^sub>E I F) = space (Pi\<^sub>M I M)

goal (1 subgoal):
 1. \<exists>A. countable A \<and> A \<subseteq> sets (Pi\<^sub>M I M) \<and> \<Union> A = space (Pi\<^sub>M I M) \<and> (\<forall>a\<in>A. emeasure (Pi\<^sub>M I M) a \<noteq> \<infinity>)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
countable (F ?j)
?f \<in> F ?j \<Longrightarrow> ?f \<in> sets (M ?j)
?f \<in> F ?j \<Longrightarrow> emeasure (M ?j) ?f \<noteq> \<infinity>
space (M ?j) = \<Union> (F ?j)
\<Union> (Pi\<^sub>E I ` Pi\<^sub>E I F) = space (Pi\<^sub>M I M)
[PROOF STEP]
show "\<exists>A. countable A \<and> A \<subseteq> sets (Pi\<^sub>M I M) \<and> \<Union>A = space (Pi\<^sub>M I M) \<and> (\<forall>a\<in>A. emeasure (Pi\<^sub>M I M) a \<noteq> \<infinity>)"
[PROOF STATE]
proof (prove)
using this:
countable (F ?j)
?f \<in> F ?j \<Longrightarrow> ?f \<in> sets (M ?j)
?f \<in> F ?j \<Longrightarrow> emeasure (M ?j) ?f \<noteq> \<infinity>
space (M ?j) = \<Union> (F ?j)
\<Union> (Pi\<^sub>E I ` Pi\<^sub>E I F) = space (Pi\<^sub>M I M)

goal (1 subgoal):
 1. \<exists>A. countable A \<and> A \<subseteq> sets (Pi\<^sub>M I M) \<and> \<Union> A = space (Pi\<^sub>M I M) \<and> (\<forall>a\<in>A. emeasure (Pi\<^sub>M I M) a \<noteq> \<infinity>)
[PROOF STEP]
by (intro exI[of _ "Pi\<^sub>E I ` Pi\<^sub>E I F"])
       (auto intro!: countable_PiE sets_PiM_I_finite
             simp: PiE_iff emeasure_PiM finite_index ennreal_prod_eq_top)
[PROOF STATE]
proof (state)
this:
\<exists>A. countable A \<and> A \<subseteq> sets (Pi\<^sub>M I M) \<and> \<Union> A = space (Pi\<^sub>M I M) \<and> (\<forall>a\<in>A. emeasure (Pi\<^sub>M I M) a \<noteq> \<infinity>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_diff_temp_dyn: "0 < a \<Longrightarrow> \<parallel>f a L s\<^sub>1 - f a L s\<^sub>2\<parallel> = \<bar>a\<bar> * \<bar>s\<^sub>1$1 - s\<^sub>2$1\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<parallel>f a L s\<^sub>1 - f a L s\<^sub>2\<parallel> = \<bar>a\<bar> \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
proof(simp add: norm_vec_def L2_set_def, unfold UNIV_4, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
assume a1: "0 < a"
[PROOF STATE]
proof (state)
this:
0 < a

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
have f2: "\<And>r ra. \<bar>(r::real) + - ra\<bar> = \<bar>ra + - r\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r ra. \<bar>r + - ra\<bar> = \<bar>ra + - r\<bar>
[PROOF STEP]
by (metis abs_minus_commute minus_real_def)
[PROOF STATE]
proof (state)
this:
\<bar>?r + - ?ra\<bar> = \<bar>?ra + - ?r\<bar>

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
have "\<And>r ra rb. (r::real) * ra + - (r * rb) = r * (ra + - rb)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r ra rb. r \<cdot> ra + - (r \<cdot> rb) = r \<cdot> (ra + - rb)
[PROOF STEP]
by (metis minus_real_def right_diff_distrib)
[PROOF STATE]
proof (state)
this:
?r \<cdot> ?ra + - (?r \<cdot> ?rb) = ?r \<cdot> (?ra + - ?rb)

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
hence "\<bar>a * (s\<^sub>1$1 + - L) + - (a * (s\<^sub>2$1 + - L))\<bar> = a * \<bar>s\<^sub>1$1 + - s\<^sub>2$1\<bar>"
[PROOF STATE]
proof (prove)
using this:
?r \<cdot> ?ra + - (?r \<cdot> ?rb) = ?r \<cdot> (?ra + - ?rb)

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
?r \<cdot> ?ra + - (?r \<cdot> ?rb) = ?r \<cdot> (?ra + - ?rb)
0 < a

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
by (simp add: abs_mult)
[PROOF STATE]
proof (state)
this:
\<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
thus "\<bar>a * (s\<^sub>2$1 - L) - a * (s\<^sub>1$1 - L)\<bar> = a * \<bar>s\<^sub>1$1 - s\<^sub>2$1\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
using f2 minus_real_def
[PROOF STATE]
proof (prove)
using this:
\<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>
\<bar>?r + - ?ra\<bar> = \<bar>?ra + - ?r\<bar>
?x - ?y = ?x + - ?y

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_set_image:
  assumes "rel_set P A B"
  assumes "\<And>a b. a \<in> A \<Longrightarrow> b \<in> B \<Longrightarrow> P a b \<Longrightarrow> Q (f a) (g b)"
  shows "rel_set Q (f ` A) (g ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_set Q (f ` A) (g ` B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
rel_set P A B
\<lbrakk>?a \<in> A; ?b \<in> B; P ?a ?b\<rbrakk> \<Longrightarrow> Q (f ?a) (g ?b)

goal (1 subgoal):
 1. rel_set Q (f ` A) (g ` B)
[PROOF STEP]
by (force intro!: rel_setI dest: rel_setD1 rel_setD2)


[STATEMENT]
lemma flatten_sequence_id:
  "\<lbrakk>cs\<noteq>[];\<forall>c \<in> set cs. flatten c = [c]\<rbrakk> \<Longrightarrow> flatten (sequence Seq cs) = cs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cs \<noteq> []; \<forall>c\<in>set cs. flatten c = [c]\<rbrakk> \<Longrightarrow> flatten (sequence Seq cs) = cs
[PROOF STEP]
apply (induct cs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; \<forall>c\<in>set []. flatten c = [c]\<rbrakk> \<Longrightarrow> flatten (sequence Seq []) = []
 2. \<And>a cs. \<lbrakk>\<lbrakk>cs \<noteq> []; \<forall>c\<in>set cs. flatten c = [c]\<rbrakk> \<Longrightarrow> flatten (sequence Seq cs) = cs; a # cs \<noteq> []; \<forall>c\<in>set (a # cs). flatten c = [c]\<rbrakk> \<Longrightarrow> flatten (sequence Seq (a # cs)) = a # cs
[PROOF STEP]
apply  simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a cs. \<lbrakk>\<lbrakk>cs \<noteq> []; \<forall>c\<in>set cs. flatten c = [c]\<rbrakk> \<Longrightarrow> flatten (sequence Seq cs) = cs; a # cs \<noteq> []; \<forall>c\<in>set (a # cs). flatten c = [c]\<rbrakk> \<Longrightarrow> flatten (sequence Seq (a # cs)) = a # cs
[PROOF STEP]
apply (case_tac cs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a cs. \<lbrakk>\<lbrakk>cs \<noteq> []; \<forall>c\<in>set cs. flatten c = [c]\<rbrakk> \<Longrightarrow> flatten (sequence Seq cs) = cs; a # cs \<noteq> []; \<forall>c\<in>set (a # cs). flatten c = [c]; cs = []\<rbrakk> \<Longrightarrow> flatten (sequence Seq (a # cs)) = a # cs
 2. \<And>a cs aa list. \<lbrakk>\<lbrakk>cs \<noteq> []; \<forall>c\<in>set cs. flatten c = [c]\<rbrakk> \<Longrightarrow> flatten (sequence Seq cs) = cs; a # cs \<noteq> []; \<forall>c\<in>set (a # cs). flatten c = [c]; cs = aa # list\<rbrakk> \<Longrightarrow> flatten (sequence Seq (a # cs)) = a # cs
[PROOF STEP]
apply  simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a cs aa list. \<lbrakk>\<lbrakk>cs \<noteq> []; \<forall>c\<in>set cs. flatten c = [c]\<rbrakk> \<Longrightarrow> flatten (sequence Seq cs) = cs; a # cs \<noteq> []; \<forall>c\<in>set (a # cs). flatten c = [c]; cs = aa # list\<rbrakk> \<Longrightarrow> flatten (sequence Seq (a # cs)) = a # cs
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma polynomial_function_minus [intro]:
  assumes f: "polynomial_function f"
    shows "polynomial_function (\<lambda>x. - f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polynomial_function (\<lambda>x. - f x)
[PROOF STEP]
using polynomial_function_cmul [OF f, of "-1"]
[PROOF STATE]
proof (prove)
using this:
polynomial_function (\<lambda>x. - 1 *\<^sub>R f x)

goal (1 subgoal):
 1. polynomial_function (\<lambda>x. - f x)
[PROOF STEP]
by simp


[STATEMENT]
lemma measure_uniform_count_measure:
  "finite A \<Longrightarrow> X \<subseteq> A \<Longrightarrow> measure (uniform_count_measure A) X = card X / card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; X \<subseteq> A\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure (uniform_count_measure A) X = real (card X) / real (card A)
[PROOF STEP]
by (simp add: emeasure_point_measure_finite uniform_count_measure_def measure_def enn2real_mult)


[STATEMENT]
lemma F_injI:
  assumes "f \<in> {0..<n} \<rightarrow> {0..<m}"
  and "(\<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i)" and "inj_on f {0..<n}"
  shows "f \<in> F_inj"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> F_inj
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> {0..<n} \<rightarrow> {0..<m}
\<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i
inj_on f {0..<n}

goal (1 subgoal):
 1. f \<in> F_inj
[PROOF STEP]
unfolding F_inj_def
[PROOF STATE]
proof (prove)
using this:
f \<in> {0..<n} \<rightarrow> {0..<m}
\<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i
inj_on f {0..<n}

goal (1 subgoal):
 1. f \<in> {f \<in> {0..<n} \<rightarrow> {0..<m}. (\<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i) \<and> inj_on f {0..<n}}
[PROOF STEP]
by simp


[STATEMENT]
lemma finite_image_of_finite[simp]:
  fixes f::"'a::finite \<Rightarrow> 'b"
  shows "finite {x. \<exists>i. x = f i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. \<exists>i. x = f i}
[PROOF STEP]
using finite_Atleast_Atmost_nat
[PROOF STATE]
proof (prove)
using this:
finite {?f x |x. x \<in> UNIV}

goal (1 subgoal):
 1. finite {x. \<exists>i. x = f i}
[PROOF STEP]
by force


[STATEMENT]
lemma rHom_add:"\<lbrakk>f \<in> rHom A R; x \<in> carrier A; y \<in> carrier A\<rbrakk> \<Longrightarrow>
                   f (x \<plusminus>\<^bsub>A\<^esub> y) = (f x) \<plusminus>\<^bsub>R\<^esub> (f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> rHom A R; x \<in> carrier A; y \<in> carrier A\<rbrakk> \<Longrightarrow> f (x \<plusminus>\<^bsub>A\<^esub> y) = f x \<plusminus>\<^bsub>R\<^esub> f y
[PROOF STEP]
by (simp add:rHom_def aHom_def)


[STATEMENT]
lemma mat0_leastIII:
  assumes A: "A \<in> carrier_mat nr nc"
  shows "mat_ge A ((0\<^sub>m nr nc) :: 'a mat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<ge>\<^sub>m 0\<^sub>m nr nc
[PROOF STEP]
proof (rule mat_geI[OF A]; unfold index_zero_mat)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < nr; j < nc\<rbrakk> \<Longrightarrow> (0::'a) \<le> A $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < nr; j < nc\<rbrakk> \<Longrightarrow> (0::'a) \<le> A $$ (i, j)
[PROOF STEP]
assume i: "i < nr" and j: "j < nc"
[PROOF STATE]
proof (state)
this:
i < nr
j < nc

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < nr; j < nc\<rbrakk> \<Longrightarrow> (0::'a) \<le> A $$ (i, j)
[PROOF STEP]
show "A $$ (i,j) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> A $$ (i, j)
[PROOF STEP]
using zero_leastIII
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> ?x

goal (1 subgoal):
 1. (0::'a) \<le> A $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> A $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inf_0_imp_0: "inf a (- a) = 0 \<Longrightarrow> a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf a (- a) = (0::'a) \<Longrightarrow> a = (0::'a)
[PROOF STEP]
apply (simp add: inf_eq_neg_sup)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup (- a) a = (0::'a) \<Longrightarrow> a = (0::'a)
[PROOF STEP]
apply (simp add: sup_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup a (- a) = (0::'a) \<Longrightarrow> a = (0::'a)
[PROOF STEP]
apply (erule sup_0_imp_0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem IF2set_natural: "IF2set o (IF2map f) = image f o IF2set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IF2set \<circ> IF2map f = (`) f \<circ> IF2set
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (IF2set \<circ> IF2map f) x = ((`) f \<circ> IF2set) x
[PROOF STEP]
apply (rule trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. (IF2set \<circ> IF2map f) x = ?s2 x
 2. \<And>x. ?s2 x = ((`) f \<circ> IF2set) x
[PROOF STEP]
apply (rule o_apply)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. IF2set (IF2map f x) = ((`) f \<circ> IF2set) x
[PROOF STEP]
apply (rule sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. ((`) f \<circ> IF2set) x = IF2set (IF2map f x)
[PROOF STEP]
apply (rule trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. ((`) f \<circ> IF2set) x = ?s8 x
 2. \<And>x. ?s8 x = IF2set (IF2map f x)
[PROOF STEP]
apply (rule o_apply)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. f ` IF2set x = IF2set (IF2map f x)
[PROOF STEP]
apply (rule conjunct2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. ?P12 x \<and> f ` IF2set x = IF2set (IF2map f x)
[PROOF STEP]
apply (rule IFset_natural)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma interchange_rows_transpose':
  shows "interchange_rows A a b = transpose (interchange_columns (transpose A) a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interchange_rows A a b = Finite_Cartesian_Product.transpose (interchange_columns (Finite_Cartesian_Product.transpose A) a b)
[PROOF STEP]
unfolding interchange_rows_def interchange_columns_def transpose_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i j. if i = a then A $ b $ j else if i = b then A $ a $ j else A $ i $ j) = (\<chi>i j. (\<chi>i j. if j = a then (\<chi>i j. A $ j $ i) $ i $ b else if j = b then (\<chi>i j. A $ j $ i) $ i $ a else (\<chi>i j. A $ j $ i) $ i $ j) $ j $ i)
[PROOF STEP]
by vector


[STATEMENT]
lemma cos_sin_csqrt:
  assumes "0 < cos(Re z)  \<or>  cos(Re z) = 0 \<and> Im z * sin(Re z) \<le> 0"
    shows "cos z = csqrt(1 - (sin z)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos z = csqrt (1 - (sin z)\<^sup>2)
[PROOF STEP]
proof (rule csqrt_unique [THEN sym])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (cos z)\<^sup>2 = 1 - (sin z)\<^sup>2
 2. 0 < Re (cos z) \<or> Re (cos z) = 0 \<and> 0 \<le> Im (cos z)
[PROOF STEP]
show "(cos z)\<^sup>2 = 1 - (sin z)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cos z)\<^sup>2 = 1 - (sin z)\<^sup>2
[PROOF STEP]
by (simp add: cos_squared_eq)
[PROOF STATE]
proof (state)
this:
(cos z)\<^sup>2 = 1 - (sin z)\<^sup>2

goal (1 subgoal):
 1. 0 < Re (cos z) \<or> Re (cos z) = 0 \<and> 0 \<le> Im (cos z)
[PROOF STEP]
qed (use assms in \<open>auto simp: Re_cos Im_cos add_pos_pos mult_le_0_iff zero_le_mult_iff\<close>)


[STATEMENT]
lemma gen_binomial_real'':
  fixes x y a :: real
  assumes "\<bar>y\<bar> < x"
  shows   "(\<lambda>n. (a gchoose n) * x powr (a - of_nat n) * y^n) sums (x + y) powr a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * x powr (a - real n) * y ^ n) sums (x + y) powr a
[PROOF STEP]
using gen_binomial_real'[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (?a gchoose n) * y ^ n * x powr (?a - real n)) sums (y + x) powr ?a

goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * x powr (a - real n) * y ^ n) sums (x + y) powr a
[PROOF STEP]
by (simp add: mult_ac add.commute)


[STATEMENT]
lemma downset_iso_iff: "(\<down>x \<subseteq> \<down>y) = (x \<le> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<down> x \<subseteq> \<down> y) = (x \<le> y)
[PROOF STEP]
using atMost_iff downset_prop order_trans
[PROOF STATE]
proof (prove)
using this:
(?i \<in> {..?k}) = (?i \<le> ?k)
\<down> ?x = {y. y \<le> ?x}
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. (\<down> x \<subseteq> \<down> y) = (x \<le> y)
[PROOF STEP]
by blast


[STATEMENT]
lemma in_sets_Sup: "(\<And>m. m \<in> M \<Longrightarrow> space m = X) \<Longrightarrow> m \<in> M \<Longrightarrow> A \<in> sets m \<Longrightarrow> A \<in> sets (Sup M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>m. m \<in> M \<Longrightarrow> space m = X; m \<in> M; A \<in> sets m\<rbrakk> \<Longrightarrow> A \<in> sets (Sup M)
[PROOF STEP]
by (subst sets_Sup_eq[where X=X]) auto


[STATEMENT]
lemma integrable_restrict_UNIV:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes S: "S \<in> sets lebesgue"
  shows  "integrable lebesgue (\<lambda>x. if x \<in> S then f x else 0) \<longleftrightarrow> integrable (lebesgue_on S) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. if x \<in> S then f x else (0::'b)) = integrable (lebesgue_on S) f
[PROOF STEP]
using has_bochner_integral_restrict_space [of S lebesgue f] assms
[PROOF STATE]
proof (prove)
using this:
S \<inter> space lebesgue \<in> sets lebesgue \<Longrightarrow> has_bochner_integral (lebesgue_on S) f ?i = has_bochner_integral lebesgue (\<lambda>x. indicat_real S x *\<^sub>R f x) ?i
S \<in> sets lebesgue

goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. if x \<in> S then f x else (0::'b)) = integrable (lebesgue_on S) f
[PROOF STEP]
by (simp add: integrable.simps indicator_scaleR_eq_if)


[STATEMENT]
lemma evenperm_id[simp]: "evenperm id = True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. evenperm id = True
[PROOF STEP]
by (rule evenperm_unique[where n = 0]) simp_all


[STATEMENT]
lemma integral_reflect_real[simp]: "integral {-b .. -a} (\<lambda>x. f (-x)) = integral {a..b::real} f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {- b..- a} (\<lambda>x. f (- x)) = integral {a..b} f
[PROOF STEP]
unfolding box_real[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cbox (- b) (- a)) (\<lambda>x. f (- x)) = integral (cbox a b) f
[PROOF STEP]
by (rule integral_reflect)


[STATEMENT]
lemma homeomorphism_imp_open_map:
  assumes hom: "homeomorphism S T f g"
    and oo: "openin (top_of_set S) U"
  shows "openin (top_of_set T) (f ` U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set T) (f ` U)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. openin (top_of_set T) (f ` U)
[PROOF STEP]
from hom oo
[PROOF STATE]
proof (chain)
picking this:
homeomorphism S T f g
openin (top_of_set S) U
[PROOF STEP]
have [simp]: "f ` U = T \<inter> g -` U"
[PROOF STATE]
proof (prove)
using this:
homeomorphism S T f g
openin (top_of_set S) U

goal (1 subgoal):
 1. f ` U = T \<inter> g -` U
[PROOF STEP]
using openin_subset
[PROOF STATE]
proof (prove)
using this:
homeomorphism S T f g
openin (top_of_set S) U
openin ?U ?S \<Longrightarrow> ?S \<subseteq> topspace ?U

goal (1 subgoal):
 1. f ` U = T \<inter> g -` U
[PROOF STEP]
by (fastforce simp: homeomorphism_def rev_image_eqI)
[PROOF STATE]
proof (state)
this:
f ` U = T \<inter> g -` U

goal (1 subgoal):
 1. openin (top_of_set T) (f ` U)
[PROOF STEP]
from hom
[PROOF STATE]
proof (chain)
picking this:
homeomorphism S T f g
[PROOF STEP]
have "continuous_on T g"
[PROOF STATE]
proof (prove)
using this:
homeomorphism S T f g

goal (1 subgoal):
 1. continuous_on T g
[PROOF STEP]
unfolding homeomorphism_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>x\<in>S. g (f x) = x) \<and> f ` S = T \<and> continuous_on S f \<and> (\<forall>y\<in>T. f (g y) = y) \<and> g ` T = S \<and> continuous_on T g

goal (1 subgoal):
 1. continuous_on T g
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on T g

goal (1 subgoal):
 1. openin (top_of_set T) (f ` U)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on T g

goal (1 subgoal):
 1. openin (top_of_set T) (f ` U)
[PROOF STEP]
have "g ` T = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` T = S
[PROOF STEP]
by (metis hom homeomorphism_def)
[PROOF STATE]
proof (state)
this:
g ` T = S

goal (1 subgoal):
 1. openin (top_of_set T) (f ` U)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous_on T g
g ` T = S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on T g
g ` T = S

goal (1 subgoal):
 1. openin (top_of_set T) (f ` U)
[PROOF STEP]
by (simp add: continuous_on_open oo)
[PROOF STATE]
proof (state)
this:
openin (top_of_set T) (f ` U)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Ring) coprime_n_idealsTr2:"\<lbrakk>ideal R C; (\<forall>k \<le> n. ideal R (J k));
       (\<forall>i \<le> n. coprime_ideals R (J i) C) \<rbrakk> \<Longrightarrow>
                                     coprime_ideals R (i\<Pi>\<^bsub>R,n\<^esub> J) C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R C; \<forall>k\<le>n. ideal R (J k); \<forall>i\<le>n. coprime_ideals R (J i) C\<rbrakk> \<Longrightarrow> coprime_ideals R (i\<Pi>\<^bsub>R,n\<^esub> J) C
[PROOF STEP]
by (simp add:coprime_n_idealsTr1)


[STATEMENT]
lemma tl_app_in[rule_format]: "l \<noteq> [] \<longrightarrow>
   map f [0..<(length l - (Suc 0:: nat))] @ [f(length l - (Suc 0 :: nat))] = map f [0..<length l]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<noteq> [] \<longrightarrow> map f [0..<length l - Suc 0] @ [f (length l - Suc 0)] = map f [0..<length l]
[PROOF STEP]
by (induction l) auto


[STATEMENT]
lemma add_mset_lt_left_lt: "a < b \<Longrightarrow> add_mset a A < add_mset b A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < b \<Longrightarrow> add_mset a A < add_mset b A
[PROOF STEP]
unfolding less_multiset\<^sub>H\<^sub>O
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < b \<Longrightarrow> add_mset a A \<noteq> add_mset b A \<and> (\<forall>y. count (add_mset b A) y < count (add_mset a A) y \<longrightarrow> (\<exists>x>y. count (add_mset a A) x < count (add_mset b A) x))
[PROOF STEP]
by auto


[STATEMENT]
theorem cos_add:
  fixes x :: "'a::{real_normed_field,banach}"
  shows "cos (x + y) = cos x * cos y - sin x * sin y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x + y) = cos x * cos y - sin x * sin y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cos (x + y) = cos x * cos y - sin x * sin y
[PROOF STEP]
have
    "(if even p \<and> even n
      then ((- 1) ^ (p div 2) * int (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0) -
     (if even p \<and> odd n
      then - ((- 1) ^ (p div 2) * int (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0) =
     (if even p then ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0)"
    if "n \<le> p" for n p :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if even p \<and> even n then (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) - (if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) = (if even p then (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?n \<le> ?p \<Longrightarrow> (if even ?p \<and> even ?n then (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a)) - (if even ?p \<and> odd ?n then - (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a)) = (if even ?p then (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a))

goal (1 subgoal):
 1. cos (x + y) = cos x * cos y - sin x * sin y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?n \<le> ?p \<Longrightarrow> (if even ?p \<and> even ?n then (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a)) - (if even ?p \<and> odd ?n then - (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a)) = (if even ?p then (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a))
[PROOF STEP]
have
    "(\<lambda>p. \<Sum>n\<le>p. (if even p then ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0))
      sums (cos x * cos y - sin x * sin y)"
[PROOF STATE]
proof (prove)
using this:
?n \<le> ?p \<Longrightarrow> (if even ?p \<and> even ?n then (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a)) - (if even ?p \<and> odd ?n then - (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a)) = (if even ?p then (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a))

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p then (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (cos x * cos y - sin x * sin y)
[PROOF STEP]
using sums_diff [OF cos_x_cos_y [of x y] sin_x_sin_y [of x y]]
[PROOF STATE]
proof (prove)
using this:
?n \<le> ?p \<Longrightarrow> (if even ?p \<and> even ?n then (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a)) - (if even ?p \<and> odd ?n then - (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a)) = (if even ?p then (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a))
(\<lambda>n. (\<Sum>na\<le>n. if even n \<and> even na then (real_of_int ((- 1) ^ (n div 2) * int (n choose na)) / fact n) *\<^sub>R x ^ na * y ^ (n - na) else (0::'a)) - (\<Sum>na\<le>n. if even n \<and> odd na then - (real_of_int ((- 1) ^ (n div 2) * int (n choose na)) / fact n) *\<^sub>R x ^ na * y ^ (n - na) else (0::'a))) sums (cos x * cos y - sin x * sin y)

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p then (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (cos x * cos y - sin x * sin y)
[PROOF STEP]
by (simp add: sum_subtractf [symmetric])
[PROOF STATE]
proof (state)
this:
(\<lambda>p. \<Sum>n\<le>p. if even p then (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (cos x * cos y - sin x * sin y)

goal (1 subgoal):
 1. cos (x + y) = cos x * cos y - sin x * sin y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>p. \<Sum>n\<le>p. if even p then (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (cos x * cos y - sin x * sin y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>p. \<Sum>n\<le>p. if even p then (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (cos x * cos y - sin x * sin y)

goal (1 subgoal):
 1. cos (x + y) = cos x * cos y - sin x * sin y
[PROOF STEP]
by (blast intro: sums_cos_x_plus_y sums_unique2)
[PROOF STATE]
proof (state)
this:
cos (x + y) = cos x * cos y - sin x * sin y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_stream_in_streams: "to_stream X \<in> streams S \<longleftrightarrow> (\<forall>n. X n \<in> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (to_stream X \<in> streams S) = (\<forall>n. X n \<in> S)
[PROOF STEP]
by (simp add: to_stream_def streams_iff_snth)


[STATEMENT]
lemma in_q65_code: "x mod 65 \<in> q65 \<longleftrightarrow> IArray.sub q65_array (x mod 65)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x mod 65 \<in> q65) = q65_array !! (x mod 65)
[PROOF STEP]
by (subst sub_q65_array) auto


[STATEMENT]
theorem RPO_S_subset_RPO_NS: "RPO_S \<subseteq> RPO_NS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RPO_S \<subseteq> RPO_NS
[PROOF STEP]
using WPO_S_subset_WPO_NS
[PROOF STATE]
proof (prove)
using this:
WPO_S \<subseteq> WPO_NS

goal (1 subgoal):
 1. RPO_S \<subseteq> RPO_NS
[PROOF STEP]
unfolding rpo_eq_wpo
[PROOF STATE]
proof (prove)
using this:
WPO_S \<subseteq> WPO_NS

goal (1 subgoal):
 1. WPO_S \<subseteq> WPO_NS
[PROOF STEP]
.


[STATEMENT]
lemma degree_drop_n:
"degree (drop_deg n f) = degree f - n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (drop_deg n f) = degree f - n
[PROOF STEP]
unfolding drop_deg_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (Poly (drop n (coeffs f))) = degree f - n
[PROOF STEP]
by (simp add: degree_eq_length_coeffs)


[STATEMENT]
lemma lemma_Infinitesimal2:
  "(\<forall>r \<in> Reals. 0 < r \<longrightarrow> x < r) \<longleftrightarrow> (\<forall>n. x < inverse(hypreal_of_nat (Suc n)))" (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>r\<in>\<real>. 0 < r \<longrightarrow> x < r) = (\<forall>n. x < inverse (hypreal_of_nat (Suc n)))
[PROOF STEP]
proof (intro iffI strip)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. \<forall>r\<in>\<real>. 0 < r \<longrightarrow> x < r \<Longrightarrow> x < inverse (hypreal_of_nat (Suc n))
 2. \<And>r. \<lbrakk>\<forall>n. x < inverse (hypreal_of_nat (Suc n)); r \<in> \<real>; 0 < r\<rbrakk> \<Longrightarrow> x < r
[PROOF STEP]
assume R: ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>n. x < inverse (hypreal_of_nat (Suc n))

goal (2 subgoals):
 1. \<And>n. \<forall>r\<in>\<real>. 0 < r \<longrightarrow> x < r \<Longrightarrow> x < inverse (hypreal_of_nat (Suc n))
 2. \<And>r. \<lbrakk>\<forall>n. x < inverse (hypreal_of_nat (Suc n)); r \<in> \<real>; 0 < r\<rbrakk> \<Longrightarrow> x < r
[PROOF STEP]
fix r::hypreal
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. \<forall>r\<in>\<real>. 0 < r \<longrightarrow> x < r \<Longrightarrow> x < inverse (hypreal_of_nat (Suc n))
 2. \<And>r. \<lbrakk>\<forall>n. x < inverse (hypreal_of_nat (Suc n)); r \<in> \<real>; 0 < r\<rbrakk> \<Longrightarrow> x < r
[PROOF STEP]
assume "r \<in> \<real>" "0 < r"
[PROOF STATE]
proof (state)
this:
r \<in> \<real>
0 < r

goal (2 subgoals):
 1. \<And>n. \<forall>r\<in>\<real>. 0 < r \<longrightarrow> x < r \<Longrightarrow> x < inverse (hypreal_of_nat (Suc n))
 2. \<And>r. \<lbrakk>\<forall>n. x < inverse (hypreal_of_nat (Suc n)); r \<in> \<real>; 0 < r\<rbrakk> \<Longrightarrow> x < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<in> \<real>
0 < r
[PROOF STEP]
obtain n y where "inverse (real (Suc n)) < y" and r: "r = hypreal_of_real y"
[PROOF STATE]
proof (prove)
using this:
r \<in> \<real>
0 < r

goal (1 subgoal):
 1. (\<And>n y. \<lbrakk>inverse (real (Suc n)) < y; r = hypreal_of_real y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis SReal_iff reals_Archimedean star_of_0_less)
[PROOF STATE]
proof (state)
this:
inverse (real (Suc n)) < y
r = hypreal_of_real y

goal (2 subgoals):
 1. \<And>n. \<forall>r\<in>\<real>. 0 < r \<longrightarrow> x < r \<Longrightarrow> x < inverse (hypreal_of_nat (Suc n))
 2. \<And>r. \<lbrakk>\<forall>n. x < inverse (hypreal_of_nat (Suc n)); r \<in> \<real>; 0 < r\<rbrakk> \<Longrightarrow> x < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (real (Suc n)) < y
r = hypreal_of_real y
[PROOF STEP]
have "inverse (1 + hypreal_of_nat n) < hypreal_of_real y"
[PROOF STATE]
proof (prove)
using this:
inverse (real (Suc n)) < y
r = hypreal_of_real y

goal (1 subgoal):
 1. inverse (1 + hypreal_of_nat n) < hypreal_of_real y
[PROOF STEP]
by (metis of_nat_Suc star_of_inverse star_of_less star_of_nat_def)
[PROOF STATE]
proof (state)
this:
inverse (1 + hypreal_of_nat n) < hypreal_of_real y

goal (2 subgoals):
 1. \<And>n. \<forall>r\<in>\<real>. 0 < r \<longrightarrow> x < r \<Longrightarrow> x < inverse (hypreal_of_nat (Suc n))
 2. \<And>r. \<lbrakk>\<forall>n. x < inverse (hypreal_of_nat (Suc n)); r \<in> \<real>; 0 < r\<rbrakk> \<Longrightarrow> x < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (1 + hypreal_of_nat n) < hypreal_of_real y
[PROOF STEP]
show "x < r"
[PROOF STATE]
proof (prove)
using this:
inverse (1 + hypreal_of_nat n) < hypreal_of_real y

goal (1 subgoal):
 1. x < r
[PROOF STEP]
by (metis R r le_less_trans less_imp_le of_nat_Suc)
[PROOF STATE]
proof (state)
this:
x < r

goal (1 subgoal):
 1. \<And>n. \<forall>r\<in>\<real>. 0 < r \<longrightarrow> x < r \<Longrightarrow> x < inverse (hypreal_of_nat (Suc n))
[PROOF STEP]
qed (meson Reals_inverse Reals_of_nat of_nat_0_less_iff positive_imp_inverse_positive zero_less_Suc)


[STATEMENT]
lemma ex_ex_eq_hint: "(\<exists>x. (\<exists>xs ys. x = f xs ys \<and> P xs ys) \<and> Q x) \<longleftrightarrow> (\<exists>xs ys. Q (f xs ys) \<and> P xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. (\<exists>xs ys. x = f xs ys \<and> P xs ys) \<and> Q x) = (\<exists>xs ys. Q (f xs ys) \<and> P xs ys)
[PROOF STEP]
by auto