[STATEMENT]
lemma pythagorean_theorem_sum:
  assumes q1: "\<And>a a'. a \<in> t \<Longrightarrow> a' \<in> t \<Longrightarrow> a \<noteq> a' \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0"
    and q2: "finite t"
  shows "(norm  (\<Sum>a\<in>t. f a))^2 = (\<Sum>a\<in>t.(norm (f a))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (sum f t))\<^sup>2 = (\<Sum>a\<in>t. (norm (f a))\<^sup>2)
[PROOF STEP]
proof (insert q1, use q2 in induction)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>a a'. \<lbrakk>a \<in> {}; a' \<in> {}; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f {}))\<^sup>2 = (\<Sum>a\<in>{}. (norm (f a))\<^sup>2)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<in> {}; ?a' \<in> {}; ?a \<noteq> ?a'\<rbrakk> \<Longrightarrow> f ?a \<bullet>\<^sub>C f ?a' = 0

goal (2 subgoals):
 1. (\<And>a a'. \<lbrakk>a \<in> {}; a' \<in> {}; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f {}))\<^sup>2 = (\<Sum>a\<in>{}. (norm (f a))\<^sup>2)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (sum f {}))\<^sup>2 = (\<Sum>a\<in>{}. (norm (f a))\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(norm (sum f {}))\<^sup>2 = (\<Sum>a\<in>{}. (norm (f a))\<^sup>2)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
(\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2)
\<lbrakk>?a \<in> insert x F; ?a' \<in> insert x F; ?a \<noteq> ?a'\<rbrakk> \<Longrightarrow> f ?a \<bullet>\<^sub>C f ?a' = 0

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
have r1: "f x \<bullet>\<^sub>C f a = 0"
    if "a \<in> F"
    for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<bullet>\<^sub>C f a = 0
[PROOF STEP]
using that insert.hyps(2) insert.prems
[PROOF STATE]
proof (prove)
using this:
a \<in> F
x \<notin> F
\<lbrakk>?a \<in> insert x F; ?a' \<in> insert x F; ?a \<noteq> ?a'\<rbrakk> \<Longrightarrow> f ?a \<bullet>\<^sub>C f ?a' = 0

goal (1 subgoal):
 1. f x \<bullet>\<^sub>C f a = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?a \<in> F \<Longrightarrow> f x \<bullet>\<^sub>C f ?a = 0

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
have "sum f F = (\<Sum>a\<in>F. f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f F = sum f F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f F = sum f F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
hence s4: "f x \<bullet>\<^sub>C sum f F = f x \<bullet>\<^sub>C (\<Sum>a\<in>F. f a)"
[PROOF STATE]
proof (prove)
using this:
sum f F = sum f F

goal (1 subgoal):
 1. f x \<bullet>\<^sub>C sum f F = f x \<bullet>\<^sub>C sum f F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f x \<bullet>\<^sub>C sum f F = f x \<bullet>\<^sub>C sum f F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f x \<bullet>\<^sub>C sum f F = f x \<bullet>\<^sub>C sum f F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
have s3: "\<dots> = (\<Sum>a\<in>F. f x \<bullet>\<^sub>C f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<bullet>\<^sub>C sum f F = (\<Sum>a\<in>F. f x \<bullet>\<^sub>C f a)
[PROOF STEP]
using cinner_sum_right
[PROOF STATE]
proof (prove)
using this:
?x \<bullet>\<^sub>C sum ?f ?A = (\<Sum>y\<in>?A. ?x \<bullet>\<^sub>C ?f y)

goal (1 subgoal):
 1. f x \<bullet>\<^sub>C sum f F = (\<Sum>a\<in>F. f x \<bullet>\<^sub>C f a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x \<bullet>\<^sub>C sum f F = (\<Sum>a\<in>F. f x \<bullet>\<^sub>C f a)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f x \<bullet>\<^sub>C sum f F = (\<Sum>a\<in>F. f x \<bullet>\<^sub>C f a)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
have s2: "\<dots> = (\<Sum>a\<in>F. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>F. f x \<bullet>\<^sub>C f a) = (\<Sum>a\<in>F. 0)
[PROOF STEP]
using r1
[PROOF STATE]
proof (prove)
using this:
?a \<in> F \<Longrightarrow> f x \<bullet>\<^sub>C f ?a = 0

goal (1 subgoal):
 1. (\<Sum>a\<in>F. f x \<bullet>\<^sub>C f a) = (\<Sum>a\<in>F. 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>F. f x \<bullet>\<^sub>C f a) = (\<Sum>a\<in>F. 0)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>F. f x \<bullet>\<^sub>C f a) = (\<Sum>a\<in>F. 0)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
have s1: "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>F. 0) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>F. 0) = 0

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 = 0
[PROOF STEP]
have xF_ortho: "f x \<bullet>\<^sub>C sum f F = 0"
[PROOF STATE]
proof (prove)
using this:
0 = 0

goal (1 subgoal):
 1. f x \<bullet>\<^sub>C sum f F = 0
[PROOF STEP]
using s2 s3
[PROOF STATE]
proof (prove)
using this:
0 = 0
(\<Sum>a\<in>F. f x \<bullet>\<^sub>C f a) = (\<Sum>a\<in>F. 0)
f x \<bullet>\<^sub>C sum f F = (\<Sum>a\<in>F. f x \<bullet>\<^sub>C f a)

goal (1 subgoal):
 1. f x \<bullet>\<^sub>C sum f F = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x \<bullet>\<^sub>C sum f F = 0

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
have "(norm (sum f (insert x F)))\<^sup>2 = (norm (f x + sum f F))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (sum f (insert x F)))\<^sup>2 = (norm (f x + sum f F))\<^sup>2
[PROOF STEP]
by (simp add: insert.hyps(1) insert.hyps(2))
[PROOF STATE]
proof (state)
this:
(norm (sum f (insert x F)))\<^sup>2 = (norm (f x + sum f F))\<^sup>2

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm (sum f (insert x F)))\<^sup>2 = (norm (f x + sum f F))\<^sup>2

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
have "\<dots> = (norm (f x))\<^sup>2 + (norm (sum f F))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (f x + sum f F))\<^sup>2 = (norm (f x))\<^sup>2 + (norm (sum f F))\<^sup>2
[PROOF STEP]
using xF_ortho
[PROOF STATE]
proof (prove)
using this:
f x \<bullet>\<^sub>C sum f F = 0

goal (1 subgoal):
 1. (norm (f x + sum f F))\<^sup>2 = (norm (f x))\<^sup>2 + (norm (sum f F))\<^sup>2
[PROOF STEP]
by (rule pythagorean_theorem)
[PROOF STATE]
proof (state)
this:
(norm (f x + sum f F))\<^sup>2 = (norm (f x))\<^sup>2 + (norm (sum f F))\<^sup>2

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm (f x + sum f F))\<^sup>2 = (norm (f x))\<^sup>2 + (norm (sum f F))\<^sup>2

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
have "\<dots> = (norm (f x))\<^sup>2 + (\<Sum>a\<in>F.(norm (f a))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (f x))\<^sup>2 + (norm (sum f F))\<^sup>2 = (norm (f x))\<^sup>2 + (\<Sum>a\<in>F. (norm (f a))\<^sup>2)
[PROOF STEP]
apply (subst insert.IH)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0
 2. (norm (f x))\<^sup>2 + (\<Sum>a\<in>F. (norm (f a))\<^sup>2) = (norm (f x))\<^sup>2 + (\<Sum>a\<in>F. (norm (f a))\<^sup>2)
[PROOF STEP]
using insert.prems
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> insert x F; ?a' \<in> insert x F; ?a \<noteq> ?a'\<rbrakk> \<Longrightarrow> f ?a \<bullet>\<^sub>C f ?a' = 0

goal (2 subgoals):
 1. \<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0
 2. (norm (f x))\<^sup>2 + (\<Sum>a\<in>F. (norm (f a))\<^sup>2) = (norm (f x))\<^sup>2 + (\<Sum>a\<in>F. (norm (f a))\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(norm (f x))\<^sup>2 + (norm (sum f F))\<^sup>2 = (norm (f x))\<^sup>2 + (\<Sum>a\<in>F. (norm (f a))\<^sup>2)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm (f x))\<^sup>2 + (norm (sum f F))\<^sup>2 = (norm (f x))\<^sup>2 + (\<Sum>a\<in>F. (norm (f a))\<^sup>2)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
have "\<dots> = (\<Sum>a\<in>insert x F.(norm (f a))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (f x))\<^sup>2 + (\<Sum>a\<in>F. (norm (f a))\<^sup>2) = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
by (simp add: insert.hyps(1) insert.hyps(2))
[PROOF STATE]
proof (state)
this:
(norm (f x))\<^sup>2 + (\<Sum>a\<in>F. (norm (f a))\<^sup>2) = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a a'. \<lbrakk>a \<in> F; a' \<in> F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0) \<Longrightarrow> (norm (sum f F))\<^sup>2 = (\<Sum>a\<in>F. (norm (f a))\<^sup>2); \<And>a a'. \<lbrakk>a \<in> insert x F; a' \<in> insert x F; a \<noteq> a'\<rbrakk> \<Longrightarrow> f a \<bullet>\<^sub>C f a' = 0\<rbrakk> \<Longrightarrow> (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)

goal (1 subgoal):
 1. (norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(norm (sum f (insert x F)))\<^sup>2 = (\<Sum>a\<in>insert x F. (norm (f a))\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_of_const_at_0: "index_of_const 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index_of_const 0 = 0
[PROOF STEP]
by (simp add: index_of_const_def)


[STATEMENT]
lemma expanded_problem_plan_bound_charles_thm:
  fixes PROB :: "'a problem"
  shows "
    problem_plan_bound_charles PROB
    = Sup (
      {
        Inf (PLS_charles (fst p) (snd p) PROB)
        | p. (fst p \<in> valid_states PROB) \<and> (snd p \<in> valid_plans PROB)})
  "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. problem_plan_bound_charles PROB = Sup {Inf (PLS_charles (fst p) (snd p) PROB) |p. fst p \<in> valid_states PROB \<and> snd p \<in> valid_plans PROB}
[PROOF STEP]
unfolding problem_plan_bound_charles_def MPLS_charles_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup {Inf (PLS_charles (fst p) (snd p) PROB) |p. fst p \<in> valid_states PROB \<and> snd p \<in> valid_plans PROB} = Sup {Inf (PLS_charles (fst p) (snd p) PROB) |p. fst p \<in> valid_states PROB \<and> snd p \<in> valid_plans PROB}
[PROOF STEP]
by blast


[STATEMENT]
lemma myless:
  fixes a b :: "'a::{ordered_ab_group_add}"
  shows "(a < b) = (0 < b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a < b) = ((0::'a) < b - a)
[PROOF STEP]
by (metis le_iff_diff_le_0 less_le_not_le myle)


[STATEMENT]
lemma matrix_rank_le_cp_rank:
fixes A :: "('a::field) tensor"
shows "mrank (matricize I A) \<le> cprank A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mrank (matricize I A) \<le> cprank A
[PROOF STEP]
using matrix_rank_le_cprank_max
[PROOF STATE]
proof (prove)
using this:
cprank_max ?r ?A \<Longrightarrow> mrank (matricize ?I ?A) \<le> ?r

goal (1 subgoal):
 1. mrank (matricize I A) \<le> cprank A
[PROOF STEP]
using cprank_max_cprank
[PROOF STATE]
proof (prove)
using this:
cprank_max ?r ?A \<Longrightarrow> mrank (matricize ?I ?A) \<le> ?r
cprank_max (cprank ?A) ?A

goal (1 subgoal):
 1. mrank (matricize I A) \<le> cprank A
[PROOF STEP]
by auto


[STATEMENT]
lemma gcd_1_nat [simp]: "gcd m 1 = 1"
  for m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd m 1 = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma radj_Inf_pres:
  fixes g :: "'b::complete_lattice \<Rightarrow> 'a::complete_lattice"
  shows "(\<exists>f. f \<stileturn> g) \<Longrightarrow> Inf_pres g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. f \<stileturn> g \<Longrightarrow> Inf_pres g
[PROOF STEP]
apply (rule antisym, simp_all add: le_fun_def adj_def, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f x. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> g (\<Sqinter> x) \<le> \<Sqinter> (g ` x)
 2. \<And>f x. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> \<Sqinter> (g ` x) \<le> g (\<Sqinter> x)
[PROOF STEP]
apply (meson INF_greatest Inf_lower dual_order.refl dual_order.trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f x. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> \<Sqinter> (g ` x) \<le> g (\<Sqinter> x)
[PROOF STEP]
by (meson Inf_greatest dual_order.refl le_INF_iff)


[STATEMENT]
lemma closure_injective_linear_image:
    fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
    shows "\<lbrakk>linear f; inj f\<rbrakk> \<Longrightarrow> f ` (closure S) = closure (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>linear f; inj f\<rbrakk> \<Longrightarrow> f ` closure S = closure (f ` S)
[PROOF STEP]
apply (rule subset_antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>linear f; inj f\<rbrakk> \<Longrightarrow> f ` closure S \<subseteq> closure (f ` S)
 2. \<lbrakk>linear f; inj f\<rbrakk> \<Longrightarrow> closure (f ` S) \<subseteq> f ` closure S
[PROOF STEP]
apply (simp add: closure_linear_image_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>linear f; inj f\<rbrakk> \<Longrightarrow> closure (f ` S) \<subseteq> f ` closure S
[PROOF STEP]
by (simp add: closure_minimal closed_injective_linear_image closure_subset image_mono)


[STATEMENT]
lemma (in domain) pmod_degree:
  assumes "subfield K R" and "p \<in> carrier (K[X])" and "q \<in> carrier (K[X])" "q \<noteq> []"
  shows "p pmod q = [] \<or> degree (p pmod q) < degree q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p pmod q = [] \<or> degree (p pmod q) < degree q
[PROOF STEP]
using long_divisionE[OF assms]
[PROOF STATE]
proof (prove)
using this:
long_divides p q (p pdiv q, p pmod q)

goal (1 subgoal):
 1. p pmod q = [] \<or> degree (p pmod q) < degree q
[PROOF STEP]
unfolding long_divides_def
[PROOF STATE]
proof (prove)
using this:
(p pdiv q, p pmod q) \<in> carrier (poly_ring R) \<times> carrier (poly_ring R) \<and> p = q \<otimes>\<^bsub>poly_ring R\<^esub> fst (p pdiv q, p pmod q) \<oplus>\<^bsub>poly_ring R\<^esub> snd (p pdiv q, p pmod q) \<and> (snd (p pdiv q, p pmod q) = [] \<or> degree (snd (p pdiv q, p pmod q)) < degree q)

goal (1 subgoal):
 1. p pmod q = [] \<or> degree (p pmod q) < degree q
[PROOF STEP]
by auto


[STATEMENT]
lemma det_upperdiagonal:
  fixes A :: "'a::comm_ring_1^^'n::{finite, wellorder}"
  shows "(\<And>i j. j < i \<Longrightarrow> to_fun A i j = 0) \<Longrightarrow> det A = (\<Prod>i\<in>UNIV. to_fun A i i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. j < i \<Longrightarrow> to_fun A i j = (0::'a)) \<Longrightarrow> Square_Matrix.det A = (\<Prod>i\<in>UNIV. to_fun A i i)
[PROOF STEP]
using det_lowerdiagonal[of "transpose A"]
[PROOF STATE]
proof (prove)
using this:
(\<And>i j. i < j \<Longrightarrow> to_fun (Square_Matrix.transpose A) i j = (0::'a)) \<Longrightarrow> Square_Matrix.det (Square_Matrix.transpose A) = (\<Prod>i\<in>UNIV. to_fun (Square_Matrix.transpose A) i i)

goal (1 subgoal):
 1. (\<And>i j. j < i \<Longrightarrow> to_fun A i j = (0::'a)) \<Longrightarrow> Square_Matrix.det A = (\<Prod>i\<in>UNIV. to_fun A i i)
[PROOF STEP]
unfolding det_transpose transpose.rep_eq
[PROOF STATE]
proof (prove)
using this:
(\<And>i j. i < j \<Longrightarrow> to_fun A j i = (0::'a)) \<Longrightarrow> Square_Matrix.det A = (\<Prod>i\<in>UNIV. to_fun A i i)

goal (1 subgoal):
 1. (\<And>i j. j < i \<Longrightarrow> to_fun A i j = (0::'a)) \<Longrightarrow> Square_Matrix.det A = (\<Prod>i\<in>UNIV. to_fun A i i)
[PROOF STEP]
.


[STATEMENT]
lemma cnorm_le_l1: "norm x \<le> (\<Sum>b\<in>CBasis. cmod (cinner x b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x \<le> (\<Sum>b\<in>CBasis. cmod (x \<bullet>\<^sub>C b))
[PROOF STEP]
apply (subst ceuclidean_representation[of x, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>b\<in>CBasis. (b \<bullet>\<^sub>C x) *\<^sub>C b) \<le> (\<Sum>b\<in>CBasis. cmod (x \<bullet>\<^sub>C b))
[PROOF STEP]
apply (rule order_trans[OF norm_sum])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>CBasis. norm ((i \<bullet>\<^sub>C x) *\<^sub>C i)) \<le> (\<Sum>b\<in>CBasis. cmod (x \<bullet>\<^sub>C b))
[PROOF STEP]
apply (auto intro!: sum_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> CBasis \<Longrightarrow> cmod (i \<bullet>\<^sub>C x) \<le> cmod (x \<bullet>\<^sub>C i)
[PROOF STEP]
by (metis cinner_commute complex_inner_1_left complex_inner_class.Cauchy_Schwarz_ineq2 mult.commute mult.left_neutral norm_one)


[STATEMENT]
lemma mirror_inorder_rev: "inorder (mirror t) = rev (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inorder (mirror t) = rev (inorder t)
[PROOF STEP]
by(induction t) auto


[STATEMENT]
lemma inner_prod_outer_prod:
  fixes a b c d :: "'a::conjugatable_field vec"
  assumes a: "a \<in> carrier_vec n" and b: "b \<in> carrier_vec n"
    and c: "c \<in> carrier_vec m" and d: "d \<in> carrier_vec m"
  shows "inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
define P where "P = outer_prod b c"
[PROOF STATE]
proof (state)
this:
P = outer_prod b c

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P = outer_prod b c
[PROOF STEP]
have dimP: "P \<in> carrier_mat n m"
[PROOF STATE]
proof (prove)
using this:
P = outer_prod b c

goal (1 subgoal):
 1. P \<in> carrier_mat n m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P = outer_prod b c
a \<in> carrier_vec n
b \<in> carrier_vec n
c \<in> carrier_vec m
d \<in> carrier_vec m

goal (1 subgoal):
 1. P \<in> carrier_mat n m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<in> carrier_mat n m

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
have "inner_prod a (P *\<^sub>v d) = (\<Sum>i=0..<n. (\<Sum>j=0..<m. conjugate (a$i) * P$$(i, j) * d$j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod a (P *\<^sub>v d) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * P $$ (i, j) * d $ j)
[PROOF STEP]
using assms dimP
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier_vec n
b \<in> carrier_vec n
c \<in> carrier_vec m
d \<in> carrier_vec m
P \<in> carrier_mat n m

goal (1 subgoal):
 1. inner_prod a (P *\<^sub>v d) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * P $$ (i, j) * d $ j)
[PROOF STEP]
apply (simp add: scalar_prod_def sum_distrib_right)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier_vec n; b \<in> carrier_vec n; c \<in> carrier_vec m; d \<in> carrier_vec m; P \<in> carrier_mat n m\<rbrakk> \<Longrightarrow> (\<Sum>i = 0..<n. \<Sum>n = 0..<m. P $$ (i, n) * d $ n * conjugate (a $ i)) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * P $$ (i, j) * d $ j)
[PROOF STEP]
apply (rule sum.cong, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>a \<in> carrier_vec n; b \<in> carrier_vec n; c \<in> carrier_vec m; d \<in> carrier_vec m; P \<in> carrier_mat n m; x < n\<rbrakk> \<Longrightarrow> (\<Sum>n = 0..<m. P $$ (x, n) * d $ n * conjugate (a $ x)) = (\<Sum>j = 0..<m. conjugate (a $ x) * P $$ (x, j) * d $ j)
[PROOF STEP]
apply (rule sum.cong, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
inner_prod a (P *\<^sub>v d) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * P $$ (i, j) * d $ j)

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod a (P *\<^sub>v d) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * P $$ (i, j) * d $ j)

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
have "\<dots> = (\<Sum>i=0..<n. (\<Sum>j=0..<m. conjugate (a$i) * b$i * conjugate(c$j) * d$j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * P $$ (i, j) * d $ j) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)
[PROOF STEP]
using P_def b c
[PROOF STATE]
proof (prove)
using this:
P = outer_prod b c
b \<in> carrier_vec n
c \<in> carrier_vec m

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * P $$ (i, j) * d $ j) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)
[PROOF STEP]
by(simp add: index_outer_prod algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * P $$ (i, j) * d $ j) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inner_prod a (P *\<^sub>v d) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)
[PROOF STEP]
have eq: "?lhs = (\<Sum>i=0..<n. (\<Sum>j=0..<m. conjugate (a$i) * b$i * conjugate(c$j) * d$j))"
[PROOF STATE]
proof (prove)
using this:
inner_prod a (P *\<^sub>v d) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)
[PROOF STEP]
using P_def
[PROOF STATE]
proof (prove)
using this:
inner_prod a (P *\<^sub>v d) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)
P = outer_prod b c

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod a (outer_prod b c *\<^sub>v d) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
have "?rhs = (\<Sum>i=0..<n. conjugate (a$i) * b$i) * (\<Sum>j=0..<m. conjugate(c$j) * d$j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod a b * inner_prod c d = (\<Sum>i = 0..<n. conjugate (a $ i) * b $ i) * (\<Sum>j = 0..<m. conjugate (c $ j) * d $ j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier_vec n
b \<in> carrier_vec n
c \<in> carrier_vec m
d \<in> carrier_vec m

goal (1 subgoal):
 1. inner_prod a b * inner_prod c d = (\<Sum>i = 0..<n. conjugate (a $ i) * b $ i) * (\<Sum>j = 0..<m. conjugate (c $ j) * d $ j)
[PROOF STEP]
by (auto simp add: scalar_prod_def algebra_simps)
[PROOF STATE]
proof (state)
this:
inner_prod a b * inner_prod c d = (\<Sum>i = 0..<n. conjugate (a $ i) * b $ i) * (\<Sum>j = 0..<m. conjugate (c $ j) * d $ j)

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod a b * inner_prod c d = (\<Sum>i = 0..<n. conjugate (a $ i) * b $ i) * (\<Sum>j = 0..<m. conjugate (c $ j) * d $ j)

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
have "\<dots> = (\<Sum>i=0..<n. (\<Sum>j=0..<m. conjugate (a$i) * b$i * conjugate(c$j) * d$j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. conjugate (a $ i) * b $ i) * (\<Sum>j = 0..<m. conjugate (c $ j) * d $ j) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier_vec n
b \<in> carrier_vec n
c \<in> carrier_vec m
d \<in> carrier_vec m

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. conjugate (a $ i) * b $ i) * (\<Sum>j = 0..<m. conjugate (c $ j) * d $ j) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)
[PROOF STEP]
by (simp add: sum_product algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. conjugate (a $ i) * b $ i) * (\<Sum>j = 0..<m. conjugate (c $ j) * d $ j) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inner_prod a b * inner_prod c d = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)
[PROOF STEP]
show "?lhs = ?rhs"
[PROOF STATE]
proof (prove)
using this:
inner_prod a b * inner_prod c d = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
inner_prod a b * inner_prod c d = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)
inner_prod a (outer_prod b c *\<^sub>v d) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (a $ i) * b $ i * conjugate (c $ j) * d $ j)

goal (1 subgoal):
 1. inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod a (outer_prod b c *\<^sub>v d) = inner_prod a b * inner_prod c d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tanh_real_eq_iff [simp]: "tanh x = tanh y \<longleftrightarrow> x = (y :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (tanh x = tanh y) = (x = y)
[PROOF STEP]
using tanh_real_strict_mono
[PROOF STATE]
proof (prove)
using this:
strict_mono tanh

goal (1 subgoal):
 1. (tanh x = tanh y) = (x = y)
[PROOF STEP]
by (simp add: strict_mono_eq)


[STATEMENT]
lemma cong_add_lcancel_0_nat: "[a + x = a] (mod n) \<longleftrightarrow> [x = 0] (mod n)"
  for a x :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a + x = a] (mod n) = [x = 0] (mod n)
[PROOF STEP]
using cong_add_lcancel_nat [of a x 0 n]
[PROOF STATE]
proof (prove)
using this:
[a + x = a + 0] (mod n) = [x = 0] (mod n)

goal (1 subgoal):
 1. [a + x = a] (mod n) = [x = 0] (mod n)
[PROOF STEP]
by simp


[STATEMENT]
lemma var0_next2:
assumes "wf (A[a' := A ! a' + 1])" "a' < n"
shows "var0 (A[a' := A ! a' + 1]) {<n} < var0 A {<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. var0 (A[a' := A ! a' + 1]) {<n} < var0 A {<n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. var0 (A[a' := A ! a' + 1]) {<n} < var0 A {<n}
[PROOF STEP]
let ?A = "A[a' := A ! a' + 1]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. var0 (A[a' := A ! a' + 1]) {<n} < var0 A {<n}
[PROOF STEP]
have 0: "card {<n} = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {<n} = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {<n} = n

goal (1 subgoal):
 1. var0 (A[a' := A ! a' + 1]) {<n} < var0 A {<n}
[PROOF STEP]
have *: "(\<Sum>a<n. ?A!a) + card {<n} \<le> n^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((!) (A[a' := A ! a' + 1])) {..<n} + card {<n} \<le> n\<^sup>2
[PROOF STEP]
using sumA_ub[OF assms(1)] 0
[PROOF STATE]
proof (prove)
using this:
sum ((!) (A[a' := A ! a' + 1])) {..<n} \<le> n * (n - 1)
card {<n} = n

goal (1 subgoal):
 1. sum ((!) (A[a' := A ! a' + 1])) {..<n} + card {<n} \<le> n\<^sup>2
[PROOF STEP]
by (simp add: power2_eq_square algebra_simps le_diff_conv2)
[PROOF STATE]
proof (state)
this:
sum ((!) (A[a' := A ! a' + 1])) {..<n} + card {<n} \<le> n\<^sup>2

goal (1 subgoal):
 1. var0 (A[a' := A ! a' + 1]) {<n} < var0 A {<n}
[PROOF STEP]
have "(\<Sum>a<n. A!a) < (\<Sum>a<n. ?A!a) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((!) A) {..<n} < sum ((!) (A[a' := A ! a' + 1])) {..<n}
[PROOF STEP]
using assms sum.remove[of "{<n}" a' "(!) A"]
[PROOF STATE]
proof (prove)
using this:
local.wf (A[a' := A ! a' + 1])
a' < n
\<lbrakk>finite {<n}; a' \<in> {<n}\<rbrakk> \<Longrightarrow> sum ((!) A) {<n} = A ! a' + sum ((!) A) ({<n} - {a'})

goal (1 subgoal):
 1. sum ((!) A) {..<n} < sum ((!) (A[a' := A ! a' + 1])) {..<n}
[PROOF STEP]
by(simp add: nth_list_update sum.If_cases lessThan_atLeast0 Diff_eq)
[PROOF STATE]
proof (state)
this:
sum ((!) A) {..<n} < sum ((!) (A[a' := A ! a' + 1])) {..<n}

goal (1 subgoal):
 1. var0 (A[a' := A ! a' + 1]) {<n} < var0 A {<n}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
sum ((!) A) {..<n} < sum ((!) (A[a' := A ! a' + 1])) {..<n}

goal (1 subgoal):
 1. var0 (A[a' := A ! a' + 1]) {<n} < var0 A {<n}
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
sum ((!) A) {..<n} < sum ((!) (A[a' := A ! a' + 1])) {..<n}
sum ((!) (A[a' := A ! a' + 1])) {..<n} + card {<n} \<le> n\<^sup>2

goal (1 subgoal):
 1. var0 (A[a' := A ! a' + 1]) {<n} < var0 A {<n}
[PROOF STEP]
unfolding var0_def
[PROOF STATE]
proof (prove)
using this:
sum ((!) A) {..<n} < sum ((!) (A[a' := A ! a' + 1])) {..<n}
sum ((!) (A[a' := A ! a' + 1])) {..<n} + card {<n} \<le> n\<^sup>2

goal (1 subgoal):
 1. n\<^sup>2 - (sum ((!) (A[a' := A ! a' + 1])) {..<n} + card {<n}) < n\<^sup>2 - (sum ((!) A) {..<n} + card {<n})
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
var0 (A[a' := A ! a' + 1]) {<n} < var0 A {<n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj_setD:
  assumes "y \<in> proj_set x A"
  shows "y \<in> A" "dist x y = infdist x A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> A &&& dist x y = infdist x A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
y \<in> proj_set x A

goal (1 subgoal):
 1. y \<in> A &&& dist x y = infdist x A
[PROOF STEP]
unfolding proj_set_def
[PROOF STATE]
proof (prove)
using this:
y \<in> {y \<in> A. dist x y = infdist x A}

goal (1 subgoal):
 1. y \<in> A &&& dist x y = infdist x A
[PROOF STEP]
by auto


[STATEMENT]
lemma norm_triangle_mono:
  "norm a \<le> r \<Longrightarrow> norm b \<le> s \<Longrightarrow> norm (a + b) \<le> r + s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>norm a \<le> r; norm b \<le> s\<rbrakk> \<Longrightarrow> norm (a + b) \<le> r + s
[PROOF STEP]
by (metis (mono_tags) add_mono_thms_linordered_semiring(1) norm_triangle_ineq order.trans)


[STATEMENT]
lemma SUP_ereal_eq_0_iff_nonneg:
  fixes f :: "_ \<Rightarrow> ereal" and A
  assumes nonneg: "\<forall>x\<in>A. f x \<ge> 0"
  and A:"A \<noteq> {}"
  shows "(SUP x\<in>A. f x) = 0 \<longleftrightarrow> (\<forall>x\<in>A. f x = 0)" (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Sup (f ` A) = 0) = (\<forall>x\<in>A. f x = 0)
[PROOF STEP]
proof(intro iffI ballI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>Sup (f ` A) = 0; x \<in> A\<rbrakk> \<Longrightarrow> f x = 0
 2. \<forall>x\<in>A. f x = 0 \<Longrightarrow> Sup (f ` A) = 0
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>Sup (f ` A) = 0; x \<in> A\<rbrakk> \<Longrightarrow> f x = 0
 2. \<forall>x\<in>A. f x = 0 \<Longrightarrow> Sup (f ` A) = 0
[PROOF STEP]
assume "?lhs" "x \<in> A"
[PROOF STATE]
proof (state)
this:
Sup (f ` A) = 0
x \<in> A

goal (2 subgoals):
 1. \<And>x. \<lbrakk>Sup (f ` A) = 0; x \<in> A\<rbrakk> \<Longrightarrow> f x = 0
 2. \<forall>x\<in>A. f x = 0 \<Longrightarrow> Sup (f ` A) = 0
[PROOF STEP]
from \<open>x \<in> A\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
[PROOF STEP]
have "f x \<le> (SUP x\<in>A. f x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> A

goal (1 subgoal):
 1. f x \<le> Sup (f ` A)
[PROOF STEP]
by(rule SUP_upper)
[PROOF STATE]
proof (state)
this:
f x \<le> Sup (f ` A)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>Sup (f ` A) = 0; x \<in> A\<rbrakk> \<Longrightarrow> f x = 0
 2. \<forall>x\<in>A. f x = 0 \<Longrightarrow> Sup (f ` A) = 0
[PROOF STEP]
with \<open>?lhs\<close>
[PROOF STATE]
proof (chain)
picking this:
Sup (f ` A) = 0
f x \<le> Sup (f ` A)
[PROOF STEP]
show "f x = 0"
[PROOF STATE]
proof (prove)
using this:
Sup (f ` A) = 0
f x \<le> Sup (f ` A)

goal (1 subgoal):
 1. f x = 0
[PROOF STEP]
using nonneg \<open>x \<in> A\<close>
[PROOF STATE]
proof (prove)
using this:
Sup (f ` A) = 0
f x \<le> Sup (f ` A)
\<forall>x\<in>A. 0 \<le> f x
x \<in> A

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

goal (1 subgoal):
 1. \<forall>x\<in>A. f x = 0 \<Longrightarrow> Sup (f ` A) = 0
[PROOF STEP]
qed (simp add: A)


[STATEMENT]
lemma connected_contains_Ioo:
  fixes A :: "'a :: linorder_topology set"
  assumes "connected A" "a \<in> A" "b \<in> A" shows "{a <..< b} \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a<..<b} \<subseteq> A
[PROOF STEP]
using connectedD_interval[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> ?z; ?z \<le> b\<rbrakk> \<Longrightarrow> ?z \<in> A

goal (1 subgoal):
 1. {a<..<b} \<subseteq> A
[PROOF STEP]
by (simp add: subset_eq Ball_def less_imp_le)


[STATEMENT]
lemma "0 \<le> (x::real) \<and> 0 \<le> y \<and> x * y = 1 \<longrightarrow> x + y \<le> x\<^sup>2 + y\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<and> 0 \<le> y \<and> x * y = 1 \<longrightarrow> x + y \<le> x\<^sup>2 + y\<^sup>2
[PROOF STEP]
by sos


[STATEMENT]
lemma some_neq_not_eq [simp]: "\<not>((SOME x :: nat. x \<noteq> i) = i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME x. x \<noteq> i) \<noteq> i
[PROOF STEP]
by (subst some_eq_ex) (metis zero_neq_numeral)


[STATEMENT]
lemma continuous_on_open_Union:
  "(\<And>s. s \<in> S \<Longrightarrow> open s) \<Longrightarrow> (\<And>s. s \<in> S \<Longrightarrow> continuous_on s f) \<Longrightarrow> continuous_on (\<Union>S) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>s. s \<in> S \<Longrightarrow> open s; \<And>s. s \<in> S \<Longrightarrow> continuous_on s f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> S) f
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>s. s \<in> S \<Longrightarrow> open s; \<And>s. s \<in> S \<Longrightarrow> \<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s)\<rbrakk> \<Longrightarrow> \<forall>x\<in>\<Union> S. (f \<longlongrightarrow> f x) (at x within \<Union> S)
[PROOF STEP]
by safe (metis open_Union at_within_open UnionI)


[STATEMENT]
lemma sums_emeasure:
  "disjoint_family F \<Longrightarrow> (\<And>i. F i \<in> sets M) \<Longrightarrow> (\<lambda>i. emeasure M (F i)) sums emeasure M (\<Union>i. F i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>disjoint_family F; \<And>i. F i \<in> sets M\<rbrakk> \<Longrightarrow> (\<lambda>i. emeasure M (F i)) sums emeasure M (\<Union> (range F))
[PROOF STEP]
unfolding sums_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>disjoint_family F; \<And>i. F i \<in> sets M\<rbrakk> \<Longrightarrow> summable (\<lambda>i. emeasure M (F i)) \<and> (\<Sum>i. emeasure M (F i)) = emeasure M (\<Union> (range F))
[PROOF STEP]
by (intro conjI suminf_emeasure) auto


[STATEMENT]
lemma share_xor_reconstruct:
  shows "share x \<bind> (\<lambda> w1. share y \<bind> (\<lambda> w2. xor_protocol w1 w2
              \<bind> (\<lambda> (a, b). reconstruct (a, b)))) = xor_evaluate x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. share x \<bind> (\<lambda>w1. share y \<bind> (\<lambda>w2. xor_protocol w1 w2 \<bind> (\<lambda>(a, b). reconstruct (a, b)))) = xor_evaluate x y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. share x \<bind> (\<lambda>w1. share y \<bind> (\<lambda>w2. xor_protocol w1 w2 \<bind> (\<lambda>(a, b). reconstruct (a, b)))) = xor_evaluate x y
[PROOF STEP]
have "(ya = (\<not> yb)) = ((x = (\<not> ya)) = (y = (\<not> yb))) = (x = (\<not> y))" for ya yb
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((ya = (\<not> yb)) = ((x = (\<not> ya)) = (y = (\<not> yb)))) = (x = (\<not> y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((?ya = (\<not> ?yb)) = ((x = (\<not> ?ya)) = (y = (\<not> ?yb)))) = (x = (\<not> y))

goal (1 subgoal):
 1. share x \<bind> (\<lambda>w1. share y \<bind> (\<lambda>w2. xor_protocol w1 w2 \<bind> (\<lambda>(a, b). reconstruct (a, b)))) = xor_evaluate x y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((?ya = (\<not> ?yb)) = ((x = (\<not> ?ya)) = (y = (\<not> ?yb)))) = (x = (\<not> y))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((?ya = (\<not> ?yb)) = ((x = (\<not> ?ya)) = (y = (\<not> ?yb)))) = (x = (\<not> y))

goal (1 subgoal):
 1. share x \<bind> (\<lambda>w1. share y \<bind> (\<lambda>w2. xor_protocol w1 w2 \<bind> (\<lambda>(a, b). reconstruct (a, b)))) = xor_evaluate x y
[PROOF STEP]
by(simp add: share_def xor_protocol_def reconstruct_def xor_evaluate_def bind_spmf_const)
[PROOF STATE]
proof (state)
this:
share x \<bind> (\<lambda>w1. share y \<bind> (\<lambda>w2. xor_protocol w1 w2 \<bind> (\<lambda>(a, b). reconstruct (a, b)))) = xor_evaluate x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma t1_space_openin_delete:
   "t1_space X \<longleftrightarrow> (\<forall>U x. openin X U \<and> x \<in> U \<longrightarrow> openin X (U - {x}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t1_space X = (\<forall>U x. openin X U \<and> x \<in> U \<longrightarrow> openin X (U - {x}))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. t1_space X \<Longrightarrow> \<forall>U x. openin X U \<and> x \<in> U \<longrightarrow> openin X (U - {x})
 2. \<forall>U x. openin X U \<and> x \<in> U \<longrightarrow> openin X (U - {x}) \<Longrightarrow> t1_space X
[PROOF STEP]
apply (meson closedin_t1_singleton in_mono openin_diff openin_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>U x. openin X U \<and> x \<in> U \<longrightarrow> openin X (U - {x}) \<Longrightarrow> t1_space X
[PROOF STEP]
by (simp add: closedin_def t1_space_closedin_singleton)


[STATEMENT]
lemma to_nat_on_inj[simp]:
  "countable A \<Longrightarrow> a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> to_nat_on A a = to_nat_on A b \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; a \<in> A; b \<in> A\<rbrakk> \<Longrightarrow> (to_nat_on A a = to_nat_on A b) = (a = b)
[PROOF STEP]
using inj_on_to_nat_on[of A]
[PROOF STATE]
proof (prove)
using this:
countable A \<Longrightarrow> inj_on (to_nat_on A) A

goal (1 subgoal):
 1. \<lbrakk>countable A; a \<in> A; b \<in> A\<rbrakk> \<Longrightarrow> (to_nat_on A a = to_nat_on A b) = (a = b)
[PROOF STEP]
by (auto dest: inj_onD)


[STATEMENT]
lemma gs_iteration_error:
  assumes "eps > 0"
  shows "dist (gs_iteration eps v) \<nu>\<^sub>b_opt < eps / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (gs_iteration eps v) \<nu>\<^sub>b_opt < eps / 2
[PROOF STEP]
using assms dist_\<L>\<^sub>b_split_opt_eps gs_iteration.simps
[PROOF STATE]
proof (prove)
using this:
0 < eps
\<lbrakk>0 < ?eps; 2 * l * dist ?v (GS_rec_fun\<^sub>b ?v) < ?eps * (1 - l)\<rbrakk> \<Longrightarrow> dist (GS_rec_fun\<^sub>b ?v) \<nu>\<^sub>b_opt < ?eps / 2
gs_iteration ?eps ?v = (if 2 * l * dist ?v (GS_rec_fun\<^sub>b ?v) < ?eps * (1 - l) \<or> ?eps \<le> 0 then GS_rec_fun\<^sub>b ?v else gs_iteration ?eps (GS_rec_fun\<^sub>b ?v))

goal (1 subgoal):
 1. dist (gs_iteration eps v) \<nu>\<^sub>b_opt < eps / 2
[PROOF STEP]
by (induction eps v rule: gs_iteration.induct) auto


[STATEMENT]
lemma Proj_orthog_ccspan_insert:
  assumes "\<And>y. y \<in> Y \<Longrightarrow> is_orthogonal x y"
  shows \<open>Proj (ccspan (insert x Y)) = proj x + Proj (ccspan Y)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Proj (ccspan (insert x Y)) = proj x + Proj (ccspan Y)
[PROOF STEP]
apply (subst asm_rl[of \<open>insert x Y = {x} \<union> Y\<close>], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Proj (ccspan ({x} \<union> Y)) = proj x + Proj (ccspan Y)
[PROOF STEP]
apply (rule Proj_orthog_ccspan_union)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> {x}; y \<in> Y\<rbrakk> \<Longrightarrow> is_orthogonal xa y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?y \<in> Y \<Longrightarrow> is_orthogonal x ?y

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> {x}; y \<in> Y\<rbrakk> \<Longrightarrow> is_orthogonal xa y
[PROOF STEP]
by auto


[STATEMENT]
lemma powr256:  "3844 ^ 256 = (1::fin7681 mod_ring)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3844 ^ 256 = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 3844 ^ 256 = 1
[PROOF STEP]
have calc1: "3844^16 = (7154::fin7681 mod_ring)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3844 ^ 16 = 7154
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3844 ^ 16 = 7154

goal (1 subgoal):
 1. 3844 ^ 256 = 1
[PROOF STEP]
have calc2: "7154^16 = (1::fin7681 mod_ring)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 7154 ^ 16 = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
7154 ^ 16 = 1

goal (1 subgoal):
 1. 3844 ^ 256 = 1
[PROOF STEP]
have "(3844::fin7681 mod_ring)^256 = (3844^16)^16"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3844 ^ 256 = (3844 ^ 16) ^ 16
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) num_double numeral_times_numeral power_mult)
[PROOF STATE]
proof (state)
this:
3844 ^ 256 = (3844 ^ 16) ^ 16

goal (1 subgoal):
 1. 3844 ^ 256 = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
3844 ^ 256 = (3844 ^ 16) ^ 16

goal (1 subgoal):
 1. 3844 ^ 256 = 1
[PROOF STEP]
have "\<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (3844 ^ 16) ^ 16 = 1
[PROOF STEP]
unfolding calc1 calc2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(3844 ^ 16) ^ 16 = 1

goal (1 subgoal):
 1. 3844 ^ 256 = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
3844 ^ 256 = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
3844 ^ 256 = 1

goal (1 subgoal):
 1. 3844 ^ 256 = 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
3844 ^ 256 = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma setsum_eq_one_le:
  fixes n::nat
  assumes "\<forall>i \<le> n. f i = 1"
  shows "(\<Sum>i \<le> n. f i) = Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..n} = Suc n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<le>n. f i = 1

goal (1 subgoal):
 1. sum f {..n} = Suc n
[PROOF STEP]
by (induct n) (auto)


[STATEMENT]
lemma linorder_rank_eq_iff:
  assumes "linorder_on B R" "finite A" "A \<subseteq> B" "x \<in> A" "y \<in> A"
  shows   "linorder_rank R A x = linorder_rank R A y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (linorder_rank R A x = linorder_rank R A y) = (x = y)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. linorder_rank R A x = linorder_rank R A y \<Longrightarrow> x = y
 2. x = y \<Longrightarrow> linorder_rank R A x = linorder_rank R A y
[PROOF STEP]
assume "linorder_rank R A x = linorder_rank R A y"
[PROOF STATE]
proof (state)
this:
linorder_rank R A x = linorder_rank R A y

goal (2 subgoals):
 1. linorder_rank R A x = linorder_rank R A y \<Longrightarrow> x = y
 2. x = y \<Longrightarrow> linorder_rank R A x = linorder_rank R A y
[PROOF STEP]
with linorder_rank_le_iff[OF assms(1-5)] linorder_rank_le_iff[OF assms(1-3) assms(5,4)]
[PROOF STATE]
proof (chain)
picking this:
(linorder_rank R A x \<le> linorder_rank R A y) = ((x, y) \<in> R)
(linorder_rank R A y \<le> linorder_rank R A x) = ((y, x) \<in> R)
linorder_rank R A x = linorder_rank R A y
[PROOF STEP]
have "(x, y) \<in> R" "(y, x) \<in> R"
[PROOF STATE]
proof (prove)
using this:
(linorder_rank R A x \<le> linorder_rank R A y) = ((x, y) \<in> R)
(linorder_rank R A y \<le> linorder_rank R A x) = ((y, x) \<in> R)
linorder_rank R A x = linorder_rank R A y

goal (1 subgoal):
 1. (x, y) \<in> R &&& (y, x) \<in> R
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
(x, y) \<in> R
(y, x) \<in> R

goal (2 subgoals):
 1. linorder_rank R A x = linorder_rank R A y \<Longrightarrow> x = y
 2. x = y \<Longrightarrow> linorder_rank R A x = linorder_rank R A y
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
linorder_on B R
finite A
A \<subseteq> B
x \<in> A
y \<in> A
(x, y) \<in> R
(y, x) \<in> R
[PROOF STEP]
show "x = y"
[PROOF STATE]
proof (prove)
using this:
linorder_on B R
finite A
A \<subseteq> B
x \<in> A
y \<in> A
(x, y) \<in> R
(y, x) \<in> R

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (auto simp: linorder_on_def antisym_def)
[PROOF STATE]
proof (state)
this:
x = y

goal (1 subgoal):
 1. x = y \<Longrightarrow> linorder_rank R A x = linorder_rank R A y
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma summable_norm_sin: "summable (\<lambda>n. norm (sin_coeff n *\<^sub>R x^n))"
  for x :: "'a::{real_normed_algebra_1,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (sin_coeff n *\<^sub>R x ^ n))
[PROOF STEP]
proof (rule summable_comparison_test [OF _ summable_norm_exp])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (norm (sin_coeff n *\<^sub>R x ^ n)) \<le> norm (?x1 ^ n /\<^sub>R fact n)
[PROOF STEP]
show "\<exists>N. \<forall>n\<ge>N. norm (norm (sin_coeff n *\<^sub>R x ^ n)) \<le> norm (x ^ n /\<^sub>R fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (norm (sin_coeff n *\<^sub>R x ^ n)) \<le> norm (x ^ n /\<^sub>R fact n)
[PROOF STEP]
unfolding sin_coeff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (norm ((if even n then 0 else (- 1) ^ ((n - Suc 0) div 2) / fact n) *\<^sub>R x ^ n)) \<le> norm (x ^ n /\<^sub>R fact n)
[PROOF STEP]
by (auto simp: divide_inverse abs_mult power_abs [symmetric] zero_le_mult_iff)
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. norm (norm (sin_coeff n *\<^sub>R x ^ n)) \<le> norm (x ^ n /\<^sub>R fact n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma clinear_compose: "clinear f \<Longrightarrow> clinear g \<Longrightarrow> clinear (g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>clinear f; clinear g\<rbrakk> \<Longrightarrow> clinear (g \<circ> f)
[PROOF STEP]
unfolding clinear_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Vector_Spaces.linear (*\<^sub>C) (*\<^sub>C) f; Vector_Spaces.linear (*\<^sub>C) (*\<^sub>C) g\<rbrakk> \<Longrightarrow> Vector_Spaces.linear (*\<^sub>C) (*\<^sub>C) (g \<circ> f)
[PROOF STEP]
by (rule Vector_Spaces.linear_compose)


[STATEMENT]
lemma bitlen_alt_def:
  "bitlen a = (if a > 0 then \<lfloor>log 2 a\<rfloor> + 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bitlen a = (if 0 < a then \<lfloor>log 2 (real_of_int a)\<rfloor> + 1 else 0)
[PROOF STEP]
by (simp add: bitlen_def floorlog_def)


[STATEMENT]
theorem positional_strategy_exists_without_deadends:
  assumes "v \<in> V" "\<And>v. v \<in> V \<Longrightarrow> \<not>deadend v"
  shows "\<exists>p. v \<in> winning_region p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p. v \<in> winning_region p
[PROOF STEP]
using assms ParityGame_axioms
[PROOF STATE]
proof (prove)
using this:
v \<in> V
?v \<in> V \<Longrightarrow> \<not> deadend ?v
ParityGame G

goal (1 subgoal):
 1. \<exists>p. v \<in> winning_region p
[PROOF STEP]
by (induct "card (\<omega> ` V)" arbitrary: G v rule: nat_less_induct)
     (rule ParityGame.positional_strategy_induction_step, simp_all)


[STATEMENT]
lemma list_mod_cases:
  assumes "length xs = n" and "n > 0"
  shows "(\<exists>x\<in>set xs. x mod n = 0) \<or>
    (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> (xs ! i) mod n = (xs ! j) mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
let ?f = "\<lambda>x. x mod n" and ?X = "set xs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
have *: "\<forall>x \<in> ?f ` ?X. x < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>(\<lambda>x. x mod n) ` set xs. x < n
[PROOF STEP]
using \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. \<forall>x\<in>(\<lambda>x. x mod n) ` set xs. x < n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>(\<lambda>x. x mod n) ` set xs. x < n

goal (1 subgoal):
 1. (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
consider (eq) "card (?f ` ?X) = card ?X" | (less) "card (?f ` ?X) < card ?X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>card ((\<lambda>x. x mod n) ` set xs) = card (set xs) \<Longrightarrow> thesis; card ((\<lambda>x. x mod n) ` set xs) < card (set xs) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using antisym_conv2 and card_image_le
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<Longrightarrow> (\<not> ?x < ?y) = (?x = ?y)
finite ?A \<Longrightarrow> card (?f ` ?A) \<le> card ?A

goal (1 subgoal):
 1. \<lbrakk>card ((\<lambda>x. x mod n) ` set xs) = card (set xs) \<Longrightarrow> thesis; card ((\<lambda>x. x mod n) ` set xs) < card (set xs) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>card ((\<lambda>x. x mod n) ` set xs) = card (set xs) \<Longrightarrow> ?thesis; card ((\<lambda>x. x mod n) ` set xs) < card (set xs) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>card ((\<lambda>x. x mod n) ` set xs) = card (set xs) \<Longrightarrow> ?thesis; card ((\<lambda>x. x mod n) ` set xs) < card (set xs) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>card ((\<lambda>x. x mod n) ` set xs) = card (set xs) \<Longrightarrow> ?thesis; card ((\<lambda>x. x mod n) ` set xs) < card (set xs) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card ((\<lambda>x. x mod n) ` set xs) = card (set xs) \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
 2. card ((\<lambda>x. x mod n) ` set xs) < card (set xs) \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
case eq
[PROOF STATE]
proof (state)
this:
card ((\<lambda>x. x mod n) ` set xs) = card (set xs)

goal (2 subgoals):
 1. card ((\<lambda>x. x mod n) ` set xs) = card (set xs) \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
 2. card ((\<lambda>x. x mod n) ` set xs) < card (set xs) \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
proof (cases "distinct xs")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. distinct xs \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
 2. \<not> distinct xs \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
assume "distinct xs"
[PROOF STATE]
proof (state)
this:
distinct xs

goal (2 subgoals):
 1. distinct xs \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
 2. \<not> distinct xs \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
with eq
[PROOF STATE]
proof (chain)
picking this:
card ((\<lambda>x. x mod n) ` set xs) = card (set xs)
distinct xs
[PROOF STEP]
have "card (?f ` ?X) = n"
[PROOF STATE]
proof (prove)
using this:
card ((\<lambda>x. x mod n) ` set xs) = card (set xs)
distinct xs

goal (1 subgoal):
 1. card ((\<lambda>x. x mod n) ` set xs) = n
[PROOF STEP]
using \<open>distinct xs\<close>
[PROOF STATE]
proof (prove)
using this:
card ((\<lambda>x. x mod n) ` set xs) = card (set xs)
distinct xs
distinct xs

goal (1 subgoal):
 1. card ((\<lambda>x. x mod n) ` set xs) = n
[PROOF STEP]
by (simp add: assms card_distinct distinct_card)
[PROOF STATE]
proof (state)
this:
card ((\<lambda>x. x mod n) ` set xs) = n

goal (2 subgoals):
 1. distinct xs \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
 2. \<not> distinct xs \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
from lessThan_conv [OF this *] and \<open>n > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. x mod n) ` set xs = {..<n}
0 < n
[PROOF STEP]
have "\<exists>x\<in>set xs. x mod n = 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. x mod n) ` set xs = {..<n}
0 < n

goal (1 subgoal):
 1. \<exists>x\<in>set xs. x mod n = 0
[PROOF STEP]
by (metis imageE lessThan_iff)
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>set xs. x mod n = 0

goal (2 subgoals):
 1. distinct xs \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
 2. \<not> distinct xs \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>set xs. x mod n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>set xs. x mod n = 0

goal (1 subgoal):
 1. (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)

goal (1 subgoal):
 1. \<not> distinct xs \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> distinct xs \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
assume "\<not> distinct xs"
[PROOF STATE]
proof (state)
this:
\<not> distinct xs

goal (1 subgoal):
 1. \<not> distinct xs \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> distinct xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> distinct xs

goal (1 subgoal):
 1. (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
by (auto) (metis distinct_conv_nth)
[PROOF STATE]
proof (state)
this:
(\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)

goal (1 subgoal):
 1. card ((\<lambda>x. x mod n) ` set xs) < card (set xs) \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card ((\<lambda>x. x mod n) ` set xs) < card (set xs) \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
card ((\<lambda>x. x mod n) ` set xs) < card (set xs)

goal (1 subgoal):
 1. card ((\<lambda>x. x mod n) ` set xs) < card (set xs) \<Longrightarrow> (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
from pigeonhole [OF this]
[PROOF STATE]
proof (chain)
picking this:
\<not> inj_on (\<lambda>x. x mod n) (set xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> inj_on (\<lambda>x. x mod n) (set xs)

goal (1 subgoal):
 1. (\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)
[PROOF STEP]
by (auto simp: inj_on_def iff: in_set_conv_nth)
[PROOF STATE]
proof (state)
this:
(\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>x\<in>set xs. x mod n = 0) \<or> (\<exists>i<length xs. \<exists>j<length xs. i \<noteq> j \<and> xs ! i mod n = xs ! j mod n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_mult_lead_coeff_aux:
  assumes "subring K R" "polynomial K p1" "polynomial K p2" and "p1 \<noteq> []" and "p2 \<noteq> []"
  shows "(coeff (poly_mult p1 p2)) (degree p1 + degree p2) = (lead_coeff p1) \<otimes> (lead_coeff p2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
have p1: "lead_coeff p1 \<in> carrier R - { \<zero> }" and p2: "lead_coeff p2 \<in> carrier R - { \<zero> }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lead_coeff p1 \<in> carrier R - {\<zero>} &&& lead_coeff p2 \<in> carrier R - {\<zero>}
[PROOF STEP]
using assms(2-5) lead_coeff_in_carrier[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
polynomial K p1
polynomial K p2
p1 \<noteq> []
p2 \<noteq> []
polynomial K (?a # ?p) \<Longrightarrow> ?a \<in> carrier R - {\<zero>}

goal (1 subgoal):
 1. lead_coeff p1 \<in> carrier R - {\<zero>} &&& lead_coeff p2 \<in> carrier R - {\<zero>}
[PROOF STEP]
by (metis list.collapse)+
[PROOF STATE]
proof (state)
this:
lead_coeff p1 \<in> carrier R - {\<zero>}
lead_coeff p2 \<in> carrier R - {\<zero>}

goal (1 subgoal):
 1. local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
have "(coeff (poly_mult p1 p2)) (degree p1 + degree p2) =
        (\<Oplus> k \<in> {..((degree p1) + (degree p2))}.
          (coeff p1) k \<otimes> (coeff p2) ((degree p1) + (degree p2) - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k))
[PROOF STEP]
using poly_mult_coeff[OF assms(2-3)[THEN polynomial_in_carrier[OF assms(1)]]]
[PROOF STATE]
proof (prove)
using this:
local.coeff (poly_mult p1 p2) = (\<lambda>i. \<Oplus>k\<in>{..i}. local.coeff p1 k \<otimes> local.coeff p2 (i - k))

goal (1 subgoal):
 1. local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k))

goal (1 subgoal):
 1. local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k))

goal (1 subgoal):
 1. local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
have " ... = (lead_coeff p1) \<otimes> (lead_coeff p2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
let ?f = "\<lambda>i. (coeff p1) i \<otimes> (coeff p2) ((degree p1) + (degree p2) - i)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
have in_carrier: "\<And>i. (coeff p1) i \<in> carrier R" "\<And>i. (coeff p2) i \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. local.coeff p1 i \<in> carrier R) &&& (\<And>i. local.coeff p2 i \<in> carrier R)
[PROOF STEP]
using coeff_in_carrier assms
[PROOF STATE]
proof (prove)
using this:
set ?p \<subseteq> carrier R \<Longrightarrow> local.coeff ?p ?i \<in> carrier R
subring K R
polynomial K p1
polynomial K p2
p1 \<noteq> []
p2 \<noteq> []

goal (1 subgoal):
 1. (\<And>i. local.coeff p1 i \<in> carrier R) &&& (\<And>i. local.coeff p2 i \<in> carrier R)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.coeff p1 ?i \<in> carrier R
local.coeff p2 ?i \<in> carrier R

goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
have "\<And>i. i < degree p1 \<Longrightarrow> ?f i = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < degree p1 \<Longrightarrow> local.coeff p1 i \<otimes> local.coeff p2 (degree p1 + degree p2 - i) = \<zero>
[PROOF STEP]
using coeff_degree[of p2] in_carrier
[PROOF STATE]
proof (prove)
using this:
degree p2 < ?i \<Longrightarrow> local.coeff p2 ?i = \<zero>
local.coeff p1 ?i \<in> carrier R
local.coeff p2 ?i \<in> carrier R

goal (1 subgoal):
 1. \<And>i. i < degree p1 \<Longrightarrow> local.coeff p1 i \<otimes> local.coeff p2 (degree p1 + degree p2 - i) = \<zero>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?i < degree p1 \<Longrightarrow> local.coeff p1 ?i \<otimes> local.coeff p2 (degree p1 + degree p2 - ?i) = \<zero>

goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?i < degree p1 \<Longrightarrow> local.coeff p1 ?i \<otimes> local.coeff p2 (degree p1 + degree p2 - ?i) = \<zero>

goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
have "\<And>i. i > degree p1 \<Longrightarrow> ?f i = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. degree p1 < i \<Longrightarrow> local.coeff p1 i \<otimes> local.coeff p2 (degree p1 + degree p2 - i) = \<zero>
[PROOF STEP]
using coeff_degree[of p1] in_carrier
[PROOF STATE]
proof (prove)
using this:
degree p1 < ?i \<Longrightarrow> local.coeff p1 ?i = \<zero>
local.coeff p1 ?i \<in> carrier R
local.coeff p2 ?i \<in> carrier R

goal (1 subgoal):
 1. \<And>i. degree p1 < i \<Longrightarrow> local.coeff p1 i \<otimes> local.coeff p2 (degree p1 + degree p2 - i) = \<zero>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree p1 < ?i \<Longrightarrow> local.coeff p1 ?i \<otimes> local.coeff p2 (degree p1 + degree p2 - ?i) = \<zero>

goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
degree p1 < ?i \<Longrightarrow> local.coeff p1 ?i \<otimes> local.coeff p2 (degree p1 + degree p2 - ?i) = \<zero>

goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
have "?f (degree p1) = (lead_coeff p1) \<otimes> (lead_coeff p2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff p1 (degree p1) \<otimes> local.coeff p2 (degree p1 + degree p2 - degree p1) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
using assms(4-5) lead_coeff_simp
[PROOF STATE]
proof (prove)
using this:
p1 \<noteq> []
p2 \<noteq> []
?p \<noteq> [] \<Longrightarrow> local.coeff ?p (degree ?p) = lead_coeff ?p

goal (1 subgoal):
 1. local.coeff p1 (degree p1) \<otimes> local.coeff p2 (degree p1 + degree p2 - degree p1) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.coeff p1 (degree p1) \<otimes> local.coeff p2 (degree p1 + degree p2 - degree p1) = lead_coeff p1 \<otimes> lead_coeff p2

goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?i < degree p1 \<Longrightarrow> local.coeff p1 ?i \<otimes> local.coeff p2 (degree p1 + degree p2 - ?i) = \<zero>
degree p1 < ?i \<Longrightarrow> local.coeff p1 ?i \<otimes> local.coeff p2 (degree p1 + degree p2 - ?i) = \<zero>
local.coeff p1 (degree p1) \<otimes> local.coeff p2 (degree p1 + degree p2 - degree p1) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
have "?f = (\<lambda>i. if degree p1 = i then (lead_coeff p1) \<otimes> (lead_coeff p2) else \<zero>)"
[PROOF STATE]
proof (prove)
using this:
?i < degree p1 \<Longrightarrow> local.coeff p1 ?i \<otimes> local.coeff p2 (degree p1 + degree p2 - ?i) = \<zero>
degree p1 < ?i \<Longrightarrow> local.coeff p1 ?i \<otimes> local.coeff p2 (degree p1 + degree p2 - ?i) = \<zero>
local.coeff p1 (degree p1) \<otimes> local.coeff p2 (degree p1 + degree p2 - degree p1) = lead_coeff p1 \<otimes> lead_coeff p2

goal (1 subgoal):
 1. (\<lambda>i. local.coeff p1 i \<otimes> local.coeff p2 (degree p1 + degree p2 - i)) = (\<lambda>i. if degree p1 = i then lead_coeff p1 \<otimes> lead_coeff p2 else \<zero>)
[PROOF STEP]
using nat_neq_iff
[PROOF STATE]
proof (prove)
using this:
?i < degree p1 \<Longrightarrow> local.coeff p1 ?i \<otimes> local.coeff p2 (degree p1 + degree p2 - ?i) = \<zero>
degree p1 < ?i \<Longrightarrow> local.coeff p1 ?i \<otimes> local.coeff p2 (degree p1 + degree p2 - ?i) = \<zero>
local.coeff p1 (degree p1) \<otimes> local.coeff p2 (degree p1 + degree p2 - degree p1) = lead_coeff p1 \<otimes> lead_coeff p2
(?m \<noteq> ?n) = (?m < ?n \<or> ?n < ?m)

goal (1 subgoal):
 1. (\<lambda>i. local.coeff p1 i \<otimes> local.coeff p2 (degree p1 + degree p2 - i)) = (\<lambda>i. if degree p1 = i then lead_coeff p1 \<otimes> lead_coeff p2 else \<zero>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>i. local.coeff p1 i \<otimes> local.coeff p2 (degree p1 + degree p2 - i)) = (\<lambda>i. if degree p1 = i then lead_coeff p1 \<otimes> lead_coeff p2 else \<zero>)

goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. local.coeff p1 i \<otimes> local.coeff p2 (degree p1 + degree p2 - i)) = (\<lambda>i. if degree p1 = i then lead_coeff p1 \<otimes> lead_coeff p2 else \<zero>)

goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
using add.finprod_singleton[of "degree p1" "{..((degree p1) + (degree p2))}"
                                     "\<lambda>i. (lead_coeff p1) \<otimes> (lead_coeff p2)"] p1 p2
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. local.coeff p1 i \<otimes> local.coeff p2 (degree p1 + degree p2 - i)) = (\<lambda>i. if degree p1 = i then lead_coeff p1 \<otimes> lead_coeff p2 else \<zero>)
\<lbrakk>degree p1 \<in> {..degree p1 + degree p2}; finite {..degree p1 + degree p2}; (\<lambda>i. lead_coeff p1 \<otimes> lead_coeff p2) \<in> {..degree p1 + degree p2} \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> (\<Oplus>j\<in>{..degree p1 + degree p2}. if degree p1 = j then lead_coeff p1 \<otimes> lead_coeff p2 else \<zero>) = lead_coeff p1 \<otimes> lead_coeff p2
lead_coeff p1 \<in> carrier R - {\<zero>}
lead_coeff p2 \<in> carrier R - {\<zero>}

goal (1 subgoal):
 1. (\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Oplus>k\<in>{..degree p1 + degree p2}. local.coeff p1 k \<otimes> local.coeff p2 (degree p1 + degree p2 - k)) = lead_coeff p1 \<otimes> lead_coeff p2

goal (1 subgoal):
 1. local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = lead_coeff p1 \<otimes> lead_coeff p2

goal (1 subgoal):
 1. local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = lead_coeff p1 \<otimes> lead_coeff p2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.coeff (poly_mult p1 p2) (degree p1 + degree p2) = lead_coeff p1 \<otimes> lead_coeff p2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_inverse_of_nat_less:
  fixes x :: "'a::archimedean_field"
  assumes "0 < x"
  shows "\<exists>n>0. inverse (of_nat n) < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n>0. inverse (of_nat n) < x
[PROOF STEP]
using reals_Archimedean [OF \<open>0 < x\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>n. inverse (of_nat (Suc n)) < x

goal (1 subgoal):
 1. \<exists>n>0. inverse (of_nat n) < x
[PROOF STEP]
by auto


[STATEMENT]
lemma ordIso_lists_cong:
assumes "r =o r'"
shows "|lists(Field r)| =o |lists(Field r')|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |lists (Field r)| =o |lists (Field r')|
[PROOF STEP]
using assms card_of_cong card_of_lists_cong
[PROOF STATE]
proof (prove)
using this:
r =o r'
?r =o ?r' \<Longrightarrow> |Field ?r| =o |Field ?r'|
|?A| =o |?B| \<Longrightarrow> |lists ?A| =o |lists ?B|

goal (1 subgoal):
 1. |lists (Field r)| =o |lists (Field r')|
[PROOF STEP]
by blast