[STATEMENT]
theorem pr_b_least2: "f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2
[PROOF STEP]
define loc_Op1 where "loc_Op1 = (\<lambda> (f::nat \<Rightarrow> nat \<Rightarrow> nat) x y z. (sgn1 (z - y)) * y + (sgn2 (z - y))*((sgn1 (f x z))*z + (sgn2 (f x z))*(Suc z)))"
[PROOF STATE]
proof (state)
this:
loc_Op1 = (\<lambda>f x y z. sgn1 (z - y) * y + sgn2 (z - y) * (sgn1 (f x z) * z + sgn2 (f x z) * Suc z))

goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2
[PROOF STEP]
define loc_Op2 where "loc_Op2 = (\<lambda> f. PrimRecOp_last (\<lambda> x. 0) (loc_Op1 f))"
[PROOF STATE]
proof (state)
this:
loc_Op2 = (\<lambda>f. PrimRecOp_last (\<lambda>x. 0) (loc_Op1 f))

goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2
[PROOF STEP]
have loc_op2_lm_1: "\<And> f x y. loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f x y. loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x y. loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y
[PROOF STEP]
fix f x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x y. loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y
[PROOF STEP]
let ?b = "loc_Op2 f x y"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x y. loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y
[PROOF STEP]
have S1: "loc_Op2 f x (Suc y) = (loc_Op1 f) x ?b y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y
[PROOF STEP]
by (simp add: loc_Op2_def)
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y

goal (1 subgoal):
 1. \<And>f x y. loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y
[PROOF STEP]
assume "?b < y"
[PROOF STATE]
proof (state)
this:
loc_Op2 f x y < y

goal (1 subgoal):
 1. \<And>f x y. loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 f x y < y
[PROOF STEP]
have "y - ?b > 0"
[PROOF STATE]
proof (prove)
using this:
loc_Op2 f x y < y

goal (1 subgoal):
 1. 0 < y - loc_Op2 f x y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < y - loc_Op2 f x y

goal (1 subgoal):
 1. \<And>f x y. loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < y - loc_Op2 f x y
[PROOF STEP]
have "loc_Op1 f x ?b y = ?b"
[PROOF STATE]
proof (prove)
using this:
0 < y - loc_Op2 f x y

goal (1 subgoal):
 1. loc_Op1 f x (loc_Op2 f x y) y = loc_Op2 f x y
[PROOF STEP]
by (simp add: loc_Op1_def)
[PROOF STATE]
proof (state)
this:
loc_Op1 f x (loc_Op2 f x y) y = loc_Op2 f x y

goal (1 subgoal):
 1. \<And>f x y. loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y
loc_Op1 f x (loc_Op2 f x y) y = loc_Op2 f x y
[PROOF STEP]
show "loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y"
[PROOF STATE]
proof (prove)
using this:
loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y
loc_Op1 f x (loc_Op2 f x y) y = loc_Op2 f x y

goal (1 subgoal):
 1. loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
loc_Op2 f x y < y \<Longrightarrow> loc_Op2 f x (Suc y) = loc_Op2 f x y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
loc_Op2 ?f ?x ?y < ?y \<Longrightarrow> loc_Op2 ?f ?x (Suc ?y) = loc_Op2 ?f ?x ?y

goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2
[PROOF STEP]
have loc_op2_lm_2: "\<And> f x y. \<lbrakk>\<not>(loc_Op2 f x y < y); f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = y
[PROOF STEP]
fix f x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = y
[PROOF STEP]
let ?b = "loc_Op2 f x y" and ?h = "loc_Op1 f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = y
[PROOF STEP]
have S1: "loc_Op2 f x (Suc y) = ?h x ?b y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y
[PROOF STEP]
by (simp add: loc_Op2_def)
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y

goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = y
[PROOF STEP]
assume "\<not>(?b < y)"
[PROOF STATE]
proof (state)
this:
\<not> loc_Op2 f x y < y

goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> loc_Op2 f x y < y
[PROOF STEP]
have S2: "y - ?b = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> loc_Op2 f x y < y

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

goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = y
[PROOF STEP]
assume "f x y \<noteq> 0"
[PROOF STATE]
proof (state)
this:
f x y \<noteq> 0

goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = y
[PROOF STEP]
with S2
[PROOF STATE]
proof (chain)
picking this:
y - loc_Op2 f x y = 0
f x y \<noteq> 0
[PROOF STEP]
have "?h x ?b y = y"
[PROOF STATE]
proof (prove)
using this:
y - loc_Op2 f x y = 0
f x y \<noteq> 0

goal (1 subgoal):
 1. loc_Op1 f x (loc_Op2 f x y) y = y
[PROOF STEP]
by (simp add: loc_Op1_def)
[PROOF STATE]
proof (state)
this:
loc_Op1 f x (loc_Op2 f x y) y = y

goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = y
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y
loc_Op1 f x (loc_Op2 f x y) y = y
[PROOF STEP]
show "loc_Op2 f x (Suc y) = y"
[PROOF STATE]
proof (prove)
using this:
loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y
loc_Op1 f x (loc_Op2 f x y) y = y

goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> loc_Op2 ?f ?x ?y < ?y; ?f ?x ?y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 ?f ?x (Suc ?y) = ?y

goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2
[PROOF STEP]
have loc_op2_lm_3: "\<And> f x y. \<lbrakk>\<not>(loc_Op2 f x y < y); f x y = 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = Suc y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y = 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = Suc y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y = 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = Suc y
[PROOF STEP]
fix f x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y = 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = Suc y
[PROOF STEP]
let ?b = "loc_Op2 f x y" and ?h = "loc_Op1 f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y = 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = Suc y
[PROOF STEP]
have S1: "loc_Op2 f x (Suc y) = ?h x ?b y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y
[PROOF STEP]
by (simp add: loc_Op2_def)
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y

goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y = 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = Suc y
[PROOF STEP]
assume "\<not>(?b < y)"
[PROOF STATE]
proof (state)
this:
\<not> loc_Op2 f x y < y

goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y = 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = Suc y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> loc_Op2 f x y < y
[PROOF STEP]
have S2: "y - ?b = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> loc_Op2 f x y < y

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

goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y = 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = Suc y
[PROOF STEP]
assume "f x y = 0"
[PROOF STATE]
proof (state)
this:
f x y = 0

goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y = 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = Suc y
[PROOF STEP]
with S2
[PROOF STATE]
proof (chain)
picking this:
y - loc_Op2 f x y = 0
f x y = 0
[PROOF STEP]
have "?h x ?b y = Suc y"
[PROOF STATE]
proof (prove)
using this:
y - loc_Op2 f x y = 0
f x y = 0

goal (1 subgoal):
 1. loc_Op1 f x (loc_Op2 f x y) y = Suc y
[PROOF STEP]
by (simp add: loc_Op1_def)
[PROOF STATE]
proof (state)
this:
loc_Op1 f x (loc_Op2 f x y) y = Suc y

goal (1 subgoal):
 1. \<And>f x y. \<lbrakk>\<not> loc_Op2 f x y < y; f x y = 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = Suc y
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y
loc_Op1 f x (loc_Op2 f x y) y = Suc y
[PROOF STEP]
show "loc_Op2 f x (Suc y) = Suc y"
[PROOF STATE]
proof (prove)
using this:
loc_Op2 f x (Suc y) = loc_Op1 f x (loc_Op2 f x y) y
loc_Op1 f x (loc_Op2 f x y) y = Suc y

goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = Suc y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = Suc y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> loc_Op2 ?f ?x ?y < ?y; ?f ?x ?y = 0\<rbrakk> \<Longrightarrow> loc_Op2 ?f ?x (Suc ?y) = Suc ?y

goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2
[PROOF STEP]
have Op2_eq_b_least2_at_point: "\<And> f x y. loc_Op2 f x y = b_least2 f x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f x y. loc_Op2 f x y = b_least2 f x y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x y. loc_Op2 f x y = b_least2 f x y
[PROOF STEP]
fix f x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x y. loc_Op2 f x y = b_least2 f x y
[PROOF STEP]
show "\<And> y. loc_Op2 f x y = b_least2 f x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. loc_Op2 f x y = b_least2 f x y
[PROOF STEP]
proof (induct_tac y)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. loc_Op2 f x 0 = b_least2 f x 0
 2. \<And>y n. loc_Op2 f x n = b_least2 f x n \<Longrightarrow> loc_Op2 f x (Suc n) = b_least2 f x (Suc n)
[PROOF STEP]
show "loc_Op2 f x 0 = b_least2 f x 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. loc_Op2 f x 0 = b_least2 f x 0
[PROOF STEP]
by (simp add: loc_Op2_def b_least2_at_zero)
[PROOF STATE]
proof (state)
this:
loc_Op2 f x 0 = b_least2 f x 0

goal (1 subgoal):
 1. \<And>y n. loc_Op2 f x n = b_least2 f x n \<Longrightarrow> loc_Op2 f x (Suc n) = b_least2 f x (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y n. loc_Op2 f x n = b_least2 f x n \<Longrightarrow> loc_Op2 f x (Suc n) = b_least2 f x (Suc n)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y n. loc_Op2 f x n = b_least2 f x n \<Longrightarrow> loc_Op2 f x (Suc n) = b_least2 f x (Suc n)
[PROOF STEP]
assume A1: "loc_Op2 f x y = b_least2 f x y"
[PROOF STATE]
proof (state)
this:
loc_Op2 f x y = b_least2 f x y

goal (1 subgoal):
 1. \<And>y n. loc_Op2 f x n = b_least2 f x n \<Longrightarrow> loc_Op2 f x (Suc n) = b_least2 f x (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 f x y = b_least2 f x y
[PROOF STEP]
show "loc_Op2 f x (Suc y) = b_least2 f x (Suc y)"
[PROOF STATE]
proof (prove)
using this:
loc_Op2 f x y = b_least2 f x y

goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>loc_Op2 f x y = b_least2 f x y; ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
 2. \<lbrakk>loc_Op2 f x y = b_least2 f x y; \<not> ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
assume A2: "loc_Op2 f x y < y"
[PROOF STATE]
proof (state)
this:
loc_Op2 f x y < y

goal (2 subgoals):
 1. \<lbrakk>loc_Op2 f x y = b_least2 f x y; ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
 2. \<lbrakk>loc_Op2 f x y = b_least2 f x y; \<not> ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 f x y < y
[PROOF STEP]
have S1: "loc_Op2 f x (Suc y) = loc_Op2 f x y"
[PROOF STATE]
proof (prove)
using this:
loc_Op2 f x y < y

goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = loc_Op2 f x y
[PROOF STEP]
by (rule loc_op2_lm_1)
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = loc_Op2 f x y

goal (2 subgoals):
 1. \<lbrakk>loc_Op2 f x y = b_least2 f x y; ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
 2. \<lbrakk>loc_Op2 f x y = b_least2 f x y; \<not> ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
from A1 A2
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 f x y = b_least2 f x y
loc_Op2 f x y < y
[PROOF STEP]
have "b_least2 f x y < y"
[PROOF STATE]
proof (prove)
using this:
loc_Op2 f x y = b_least2 f x y
loc_Op2 f x y < y

goal (1 subgoal):
 1. b_least2 f x y < y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b_least2 f x y < y

goal (2 subgoals):
 1. \<lbrakk>loc_Op2 f x y = b_least2 f x y; ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
 2. \<lbrakk>loc_Op2 f x y = b_least2 f x y; \<not> ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b_least2 f x y < y
[PROOF STEP]
have S2: "b_least2 f x (Suc y) = b_least2 f x y"
[PROOF STATE]
proof (prove)
using this:
b_least2 f x y < y

goal (1 subgoal):
 1. b_least2 f x (Suc y) = b_least2 f x y
[PROOF STEP]
by (rule b_least2_aux2)
[PROOF STATE]
proof (state)
this:
b_least2 f x (Suc y) = b_least2 f x y

goal (2 subgoals):
 1. \<lbrakk>loc_Op2 f x y = b_least2 f x y; ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
 2. \<lbrakk>loc_Op2 f x y = b_least2 f x y; \<not> ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
from A1 S1 S2
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 f x y = b_least2 f x y
loc_Op2 f x (Suc y) = loc_Op2 f x y
b_least2 f x (Suc y) = b_least2 f x y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
loc_Op2 f x y = b_least2 f x y
loc_Op2 f x (Suc y) = loc_Op2 f x y
b_least2 f x (Suc y) = b_least2 f x y

goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = b_least2 f x (Suc y)

goal (1 subgoal):
 1. \<lbrakk>loc_Op2 f x y = b_least2 f x y; \<not> loc_Op2 f x y < y\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>loc_Op2 f x y = b_least2 f x y; \<not> loc_Op2 f x y < y\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
assume A3: "\<not> loc_Op2 f x y < y"
[PROOF STATE]
proof (state)
this:
\<not> loc_Op2 f x y < y

goal (1 subgoal):
 1. \<lbrakk>loc_Op2 f x y = b_least2 f x y; \<not> loc_Op2 f x y < y\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
have A3': "b_least2 f x y = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b_least2 f x y = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b_least2 f x y = y
[PROOF STEP]
have "b_least2 f x y \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b_least2 f x y \<le> y
[PROOF STEP]
by (rule b_least2_le_arg)
[PROOF STATE]
proof (state)
this:
b_least2 f x y \<le> y

goal (1 subgoal):
 1. b_least2 f x y = y
[PROOF STEP]
from A1 A3 this
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 f x y = b_least2 f x y
\<not> loc_Op2 f x y < y
b_least2 f x y \<le> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
loc_Op2 f x y = b_least2 f x y
\<not> loc_Op2 f x y < y
b_least2 f x y \<le> y

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
b_least2 f x y = y

goal (1 subgoal):
 1. \<lbrakk>loc_Op2 f x y = b_least2 f x y; \<not> loc_Op2 f x y < y\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b_least2 f x y = y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b_least2 f x y = y

goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>b_least2 f x y = y; ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
 2. \<lbrakk>b_least2 f x y = y; \<not> ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
assume A4: "f x y \<noteq> 0"
[PROOF STATE]
proof (state)
this:
f x y \<noteq> 0

goal (2 subgoals):
 1. \<lbrakk>b_least2 f x y = y; ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
 2. \<lbrakk>b_least2 f x y = y; \<not> ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
with A3
[PROOF STATE]
proof (chain)
picking this:
\<not> loc_Op2 f x y < y
f x y \<noteq> 0
[PROOF STEP]
have S3: "loc_Op2 f x (Suc y) = y"
[PROOF STATE]
proof (prove)
using this:
\<not> loc_Op2 f x y < y
f x y \<noteq> 0

goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = y
[PROOF STEP]
by (rule loc_op2_lm_2)
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = y

goal (2 subgoals):
 1. \<lbrakk>b_least2 f x y = y; ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
 2. \<lbrakk>b_least2 f x y = y; \<not> ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
from A3' A4
[PROOF STATE]
proof (chain)
picking this:
b_least2 f x y = y
f x y \<noteq> 0
[PROOF STEP]
have S4: "b_least2 f x (Suc y) = y"
[PROOF STATE]
proof (prove)
using this:
b_least2 f x y = y
f x y \<noteq> 0

goal (1 subgoal):
 1. b_least2 f x (Suc y) = y
[PROOF STEP]
by (rule b_least2_aux3)
[PROOF STATE]
proof (state)
this:
b_least2 f x (Suc y) = y

goal (2 subgoals):
 1. \<lbrakk>b_least2 f x y = y; ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
 2. \<lbrakk>b_least2 f x y = y; \<not> ?P1\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
from S3 S4
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 f x (Suc y) = y
b_least2 f x (Suc y) = y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
loc_Op2 f x (Suc y) = y
b_least2 f x (Suc y) = y

goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = b_least2 f x (Suc y)

goal (1 subgoal):
 1. \<lbrakk>b_least2 f x y = y; \<not> f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>b_least2 f x y = y; \<not> f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
assume "\<not> f x y \<noteq>  0"
[PROOF STATE]
proof (state)
this:
\<not> f x y \<noteq> 0

goal (1 subgoal):
 1. \<lbrakk>b_least2 f x y = y; \<not> f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> f x y \<noteq> 0
[PROOF STEP]
have A5: "f x y = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> f x y \<noteq> 0

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

goal (1 subgoal):
 1. \<lbrakk>b_least2 f x y = y; \<not> f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
with A3
[PROOF STATE]
proof (chain)
picking this:
\<not> loc_Op2 f x y < y
f x y = 0
[PROOF STEP]
have S5: "loc_Op2 f x (Suc y) = Suc y"
[PROOF STATE]
proof (prove)
using this:
\<not> loc_Op2 f x y < y
f x y = 0

goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = Suc y
[PROOF STEP]
by (rule loc_op2_lm_3)
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = Suc y

goal (1 subgoal):
 1. \<lbrakk>b_least2 f x y = y; \<not> f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
from A3' A5
[PROOF STATE]
proof (chain)
picking this:
b_least2 f x y = y
f x y = 0
[PROOF STEP]
have S6: "b_least2 f x (Suc y) = Suc y"
[PROOF STATE]
proof (prove)
using this:
b_least2 f x y = y
f x y = 0

goal (1 subgoal):
 1. b_least2 f x (Suc y) = Suc y
[PROOF STEP]
by (rule b_least2_aux4)
[PROOF STATE]
proof (state)
this:
b_least2 f x (Suc y) = Suc y

goal (1 subgoal):
 1. \<lbrakk>b_least2 f x y = y; \<not> f x y \<noteq> 0\<rbrakk> \<Longrightarrow> loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
from S5 S6
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 f x (Suc y) = Suc y
b_least2 f x (Suc y) = Suc y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
loc_Op2 f x (Suc y) = Suc y
b_least2 f x (Suc y) = Suc y

goal (1 subgoal):
 1. loc_Op2 f x (Suc y) = b_least2 f x (Suc y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = b_least2 f x (Suc y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = b_least2 f x (Suc y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
loc_Op2 f x (Suc y) = b_least2 f x (Suc y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
loc_Op2 f x ?y = b_least2 f x ?y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
loc_Op2 ?f ?x ?y = b_least2 ?f ?x ?y

goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2
[PROOF STEP]
have Op2_eq_b_least2: "loc_Op2 = b_least2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. loc_Op2 = b_least2
[PROOF STEP]
by (simp add: Op2_eq_b_least2_at_point ext)
[PROOF STATE]
proof (state)
this:
loc_Op2 = b_least2

goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2
[PROOF STEP]
assume A1: "f \<in> PrimRec2"
[PROOF STATE]
proof (state)
this:
f \<in> PrimRec2

goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2
[PROOF STEP]
have pr_loc_Op2: "loc_Op2 f \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. loc_Op2 f \<in> PrimRec2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. loc_Op2 f \<in> PrimRec2
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
f \<in> PrimRec2
[PROOF STEP]
have S1: "loc_Op1 f \<in> PrimRec3"
[PROOF STATE]
proof (prove)
using this:
f \<in> PrimRec2

goal (1 subgoal):
 1. loc_Op1 f \<in> PrimRec3
[PROOF STEP]
by (simp add: loc_Op1_def, prec)
[PROOF STATE]
proof (state)
this:
loc_Op1 f \<in> PrimRec3

goal (1 subgoal):
 1. loc_Op2 f \<in> PrimRec2
[PROOF STEP]
from pr_zero S1
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. 0) \<in> PrimRec1
loc_Op1 f \<in> PrimRec3
[PROOF STEP]
have S2: "PrimRecOp_last (\<lambda> x. 0) (loc_Op1 f) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. 0) \<in> PrimRec1
loc_Op1 f \<in> PrimRec3

goal (1 subgoal):
 1. PrimRecOp_last (\<lambda>x. 0) (loc_Op1 f) \<in> PrimRec2
[PROOF STEP]
by (rule pr_rec_last)
[PROOF STATE]
proof (state)
this:
PrimRecOp_last (\<lambda>x. 0) (loc_Op1 f) \<in> PrimRec2

goal (1 subgoal):
 1. loc_Op2 f \<in> PrimRec2
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
PrimRecOp_last (\<lambda>x. 0) (loc_Op1 f) \<in> PrimRec2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
PrimRecOp_last (\<lambda>x. 0) (loc_Op1 f) \<in> PrimRec2

goal (1 subgoal):
 1. loc_Op2 f \<in> PrimRec2
[PROOF STEP]
by (simp add: loc_Op2_def)
[PROOF STATE]
proof (state)
this:
loc_Op2 f \<in> PrimRec2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
loc_Op2 f \<in> PrimRec2

goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> b_least2 f \<in> PrimRec2
[PROOF STEP]
from Op2_eq_b_least2 this
[PROOF STATE]
proof (chain)
picking this:
loc_Op2 = b_least2
loc_Op2 f \<in> PrimRec2
[PROOF STEP]
show "b_least2 f \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
loc_Op2 = b_least2
loc_Op2 f \<in> PrimRec2

goal (1 subgoal):
 1. b_least2 f \<in> PrimRec2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b_least2 f \<in> PrimRec2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_mset_eq_add_mset: \<open>add_mset a M = add_mset b M' \<longleftrightarrow>
  (a = b \<and> M = M') \<or> (a \<noteq> b \<and> b \<in># M \<and> add_mset a (M - {#b#}) = M')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (add_mset a M = add_mset b M') = (a = b \<and> M = M' \<or> a \<noteq> b \<and> b \<in># M \<and> add_mset a (remove1_mset b M) = M')
[PROOF STEP]
by (metis add_mset_eq_add_mset_ne add_mset_remove_trivial union_single_eq_member)


[STATEMENT]
lemma fps_conv_radius_cos [simp]:
  fixes c :: "'a :: {banach, real_normed_field, field_char_0}"
  shows "fps_conv_radius (fps_cos c) = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_conv_radius (fps_cos c) = \<infinity>
[PROOF STEP]
proof (cases "c = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
 2. c \<noteq> (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> (0::'a)

goal (2 subgoals):
 1. c = (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
 2. c \<noteq> (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
[PROOF STEP]
have "\<infinity> = conv_radius (\<lambda>n. of_real (cos_coeff n) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<infinity> = conv_radius (\<lambda>n. of_real (cos_coeff n))
[PROOF STEP]
proof (rule sym, rule conv_radius_inftyI'', rule summable_norm_cancel, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. summable (\<lambda>n. norm (of_real (cos_coeff n) * z ^ n))
[PROOF STEP]
case (1 z)
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>z. summable (\<lambda>n. norm (of_real (cos_coeff n) * z ^ n))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (of_real (cos_coeff n) * z ^ n))
[PROOF STEP]
using summable_norm_cos[of z]
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. norm (cos_coeff n *\<^sub>R z ^ n))

goal (1 subgoal):
 1. summable (\<lambda>n. norm (of_real (cos_coeff n) * z ^ n))
[PROOF STEP]
by (simp add: norm_mult)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. norm (of_real (cos_coeff n) * z ^ n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<infinity> = conv_radius (\<lambda>n. of_real (cos_coeff n))

goal (2 subgoals):
 1. c = (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
 2. c \<noteq> (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<infinity> = conv_radius (\<lambda>n. of_real (cos_coeff n))

goal (2 subgoals):
 1. c = (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
 2. c \<noteq> (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
[PROOF STEP]
have "\<dots> / norm c = conv_radius (\<lambda>n. c ^ n * of_real (cos_coeff n) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius (\<lambda>n. of_real (cos_coeff n)) / ereal (norm c) = conv_radius (\<lambda>n. c ^ n * of_real (cos_coeff n))
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)

goal (1 subgoal):
 1. conv_radius (\<lambda>n. of_real (cos_coeff n)) / ereal (norm c) = conv_radius (\<lambda>n. c ^ n * of_real (cos_coeff n))
[PROOF STEP]
by (subst conv_radius_mult_power) auto
[PROOF STATE]
proof (state)
this:
conv_radius (\<lambda>n. of_real (cos_coeff n)) / ereal (norm c) = conv_radius (\<lambda>n. c ^ n * of_real (cos_coeff n))

goal (2 subgoals):
 1. c = (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
 2. c \<noteq> (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
conv_radius (\<lambda>n. of_real (cos_coeff n)) / ereal (norm c) = conv_radius (\<lambda>n. c ^ n * of_real (cos_coeff n))

goal (2 subgoals):
 1. c = (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
 2. c \<noteq> (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
[PROOF STEP]
have "\<dots> = fps_conv_radius (fps_cos c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius (\<lambda>n. c ^ n * of_real (cos_coeff n)) = fps_conv_radius (fps_cos c)
[PROOF STEP]
unfolding fps_conv_radius_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius (\<lambda>n. c ^ n * of_real (cos_coeff n)) = conv_radius (fps_nth (fps_cos c))
[PROOF STEP]
by (rule conv_radius_cong_weak) (auto simp add: fps_cos_def cos_coeff_def)
[PROOF STATE]
proof (state)
this:
conv_radius (\<lambda>n. c ^ n * of_real (cos_coeff n)) = fps_conv_radius (fps_cos c)

goal (2 subgoals):
 1. c = (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
 2. c \<noteq> (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<infinity> / ereal (norm c) = fps_conv_radius (fps_cos c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<infinity> / ereal (norm c) = fps_conv_radius (fps_cos c)

goal (1 subgoal):
 1. fps_conv_radius (fps_cos c) = \<infinity>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fps_conv_radius (fps_cos c) = \<infinity>

goal (1 subgoal):
 1. c = (0::'a) \<Longrightarrow> fps_conv_radius (fps_cos c) = \<infinity>
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma sqrt_nat_floor[simp]: "sqrt_nat_floor x = \<lfloor> sqrt (real x) \<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt_nat_floor x = \<lfloor>sqrt (real x)\<rfloor>
[PROOF STEP]
unfolding sqrt_nat_floor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root_nat_floor 2 x = \<lfloor>sqrt (real x)\<rfloor>
[PROOF STEP]
by (simp add: sqrt_def)


[STATEMENT]
lemma foldli_disjoint:
    "det_fold_set X (\<lambda>x. x) (\<lambda>x _. \<not>x\<in>s2) True (\<lambda>s1. op_set_disjoint s1 s2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det_fold_set X (\<lambda>x. x) (\<lambda>x _. x \<notin> s2) True (\<lambda>s1. op_set_disjoint s1 s2)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l. \<lbrakk>distinct l; sorted_wrt X l\<rbrakk> \<Longrightarrow> foldli l (\<lambda>x. x) (\<lambda>x _. x \<notin> s2) True = op_set_disjoint (set l) s2
[PROOF STEP]
using foldli_disjoint_aux[where b=True]
[PROOF STATE]
proof (prove)
using this:
foldli ?l1.0 (\<lambda>x. x) (\<lambda>x _. x \<notin> ?s2.0) True = (True \<and> op_set_disjoint (set ?l1.0) ?s2.0)

goal (1 subgoal):
 1. \<And>l. \<lbrakk>distinct l; sorted_wrt X l\<rbrakk> \<Longrightarrow> foldli l (\<lambda>x. x) (\<lambda>x _. x \<notin> s2) True = op_set_disjoint (set l) s2
[PROOF STEP]
by simp


[STATEMENT]
lemma fds_totient: "fds (\<lambda>n. of_nat (totient n)) = fds of_nat * fds moebius_mu"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds (\<lambda>n. of_nat (totient n)) = fds of_nat * fds moebius_mu
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fds (\<lambda>n. of_nat (totient n)) = fds of_nat * fds moebius_mu
[PROOF STEP]
have "fds (\<lambda>n. of_nat (totient n)) * fds_zeta * fds moebius_mu = fds of_nat * fds moebius_mu"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds (\<lambda>n. of_nat (totient n)) * fds_zeta * fds moebius_mu = fds of_nat * fds moebius_mu
[PROOF STEP]
by (simp add: fds_totient_times_zeta)
[PROOF STATE]
proof (state)
this:
fds (\<lambda>n. of_nat (totient n)) * fds_zeta * fds moebius_mu = fds of_nat * fds moebius_mu

goal (1 subgoal):
 1. fds (\<lambda>n. of_nat (totient n)) = fds of_nat * fds moebius_mu
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds (\<lambda>n. of_nat (totient n)) * fds_zeta * fds moebius_mu = fds of_nat * fds moebius_mu

goal (1 subgoal):
 1. fds (\<lambda>n. of_nat (totient n)) = fds of_nat * fds moebius_mu
[PROOF STEP]
have "fds (\<lambda>n. of_nat (totient n)) * fds_zeta * fds moebius_mu =
               fds (\<lambda>n. of_nat (totient n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds (\<lambda>n. of_nat (totient n)) * fds_zeta * fds moebius_mu = fds (\<lambda>n. of_nat (totient n))
[PROOF STEP]
by (simp only: mult.assoc fds_zeta_times_moebius_mu mult_1_right)
[PROOF STATE]
proof (state)
this:
fds (\<lambda>n. of_nat (totient n)) * fds_zeta * fds moebius_mu = fds (\<lambda>n. of_nat (totient n))

goal (1 subgoal):
 1. fds (\<lambda>n. of_nat (totient n)) = fds of_nat * fds moebius_mu
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds (\<lambda>n. of_nat (totient n)) = fds of_nat * fds moebius_mu
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fds (\<lambda>n. of_nat (totient n)) = fds of_nat * fds moebius_mu

goal (1 subgoal):
 1. fds (\<lambda>n. of_nat (totient n)) = fds of_nat * fds moebius_mu
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fds (\<lambda>n. of_nat (totient n)) = fds of_nat * fds moebius_mu

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem rivest_perfect_hiding_asym:
  assumes lossless_\<A>: "rivest_commit.lossless (\<A> n)"
  shows "rivest_commit.perfect_hiding_ind_cpa n (\<A> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rivest_commit.perfect_hiding_ind_cpa n (\<A> n)
[PROOF STEP]
by (simp add: lossless_\<A> rivest_perfect_hiding)


[STATEMENT]
lemma Compl_FP:
    "-(FP F) = (UN act: Acts F. -{s. act``{s} <= {s}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - FP F = (\<Union>act\<in>Acts F. - {s. act `` {s} \<subseteq> {s}})
[PROOF STEP]
by (simp add: FP_def stable_def constrains_def, blast)


[STATEMENT]
lemma binomial_altdef_of_nat:
  "k \<le> n \<Longrightarrow> of_nat (n choose k) = (\<Prod>i = 0..<k. of_nat (n - i) / of_nat (k - i) :: 'a)"
  for n k :: nat and x :: "'a::field_char_0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> of_nat (n choose k) = (\<Prod>i = 0..<k. of_nat (n - i) / of_nat (k - i))
[PROOF STEP]
by (simp add: gbinomial_altdef_of_nat binomial_gbinomial of_nat_diff)


[STATEMENT]
lemma REC_mono_ref[refine_mono]:
  "\<lbrakk>trimono B; \<And>D x. B D x \<le> B' D x\<rbrakk> \<Longrightarrow> REC B x \<le> REC B' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trimono B; \<And>D x. B D x \<le> B' D x\<rbrakk> \<Longrightarrow> REC B x \<le> REC B' x
[PROOF STEP]
unfolding REC_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trimono B; \<And>D x. B D x \<le> B' D x\<rbrakk> \<Longrightarrow> (if trimono B then lfp B x else top) \<le> (if trimono B' then lfp B' x else top)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>trimono B; \<And>D x. B D x \<le> B' D x; trimono B'\<rbrakk> \<Longrightarrow> lfp B x \<le> lfp B' x
[PROOF STEP]
apply (rule lfp_mono[THEN le_funD])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Z. \<lbrakk>trimono B; \<And>D x. B D x \<le> B' D x; trimono B'\<rbrakk> \<Longrightarrow> B Z \<le> B' Z
[PROOF STEP]
by (rule le_funI)


[STATEMENT]
lemma inv1_inv1: "inv1 \<circ> inv1 = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv1 \<circ> inv1 = id
[PROOF STEP]
by (simp add: fun_eq_iff comp_def inv1_def)


[STATEMENT]
lemma eq_lemma: "\<And> x y. rec_exec rec_eq [x, y] = (if x = y then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. rec_exec rec_eq [x, y] = (if x = y then 1 else 0)
[PROOF STEP]
by(induct_tac y, auto simp: rec_exec.simps rec_eq_def constn_lemma add_lemma minus_lemma)


[STATEMENT]
lemma powr_eq_one_iff_gen[simp]: "a.^x = 1 \<longleftrightarrow> x = 0" if "a > 0" "a \<noteq> 1" for a x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a .^ x = 1) = (x = 0)
[PROOF STEP]
by (metis powr_eq_0_iff powr_inj powr_zero_eq_one that)


[STATEMENT]
lemma list_all2_antisym:
  "\<lbrakk> (\<And>x y. \<lbrakk>P x y; Q y x\<rbrakk> \<Longrightarrow> x = y); list_all2 P xs ys; list_all2 Q ys xs \<rbrakk>
  \<Longrightarrow> xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y. \<lbrakk>P x y; Q y x\<rbrakk> \<Longrightarrow> x = y; list_all2 P xs ys; list_all2 Q ys xs\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
by (simp add: list_all2_conv_all_nth nth_equalityI)


[STATEMENT]
lemma vec_of_basis_enum_zero:
  defines "nA \<equiv> length (canonical_basis :: 'a::basis_enum list)"
  shows "vec_of_basis_enum (0::'a) = 0\<^sub>v nA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_basis_enum (0::'a) = 0\<^sub>v nA
[PROOF STEP]
by (metis assms carrier_vecI dim_vec_of_basis_enum' minus_cancel_vec right_minus_eq vec_of_basis_enum_minus)


[STATEMENT]
lemma LIMSEQ_neg_powr:
  assumes s: "s < 0"
  shows "(%x. (real x) powr s) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real x powr s) \<longlonglongrightarrow> 0
[PROOF STEP]
by (rule tendsto_neg_powr[OF assms filterlim_real_sequentially])


[STATEMENT]
lemma transpose_matrix[simp]: "Rep_matrix(transpose_matrix A) j i = Rep_matrix A i j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_matrix (transpose_matrix A) j i = Rep_matrix A i j
[PROOF STEP]
by (simp add: transpose_matrix_def)


[STATEMENT]
lemma one_dim_clinear_eqI:
  assumes "(x::'a::one_dim) \<noteq> 0" and "clinear f" and "clinear g" and "f x = g x"
  shows "f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = g
[PROOF STEP]
proof (rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. f x = g x
[PROOF STEP]
fix y :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. f x = g x
[PROOF STEP]
from \<open>f x = g x\<close>
[PROOF STATE]
proof (chain)
picking this:
f x = g x
[PROOF STEP]
have \<open>one_dim_iso x *\<^sub>C f 1 = one_dim_iso x *\<^sub>C g 1\<close>
[PROOF STATE]
proof (prove)
using this:
f x = g x

goal (1 subgoal):
 1. one_dim_iso x *\<^sub>C f (1::'a) = one_dim_iso x *\<^sub>C g (1::'a)
[PROOF STEP]
by (metis assms(2) assms(3) complex_vector.linear_scale one_dim_scaleC_1)
[PROOF STATE]
proof (state)
this:
one_dim_iso x *\<^sub>C f (1::'a) = one_dim_iso x *\<^sub>C g (1::'a)

goal (1 subgoal):
 1. \<And>x. f x = g x
[PROOF STEP]
hence "f 1 = g 1"
[PROOF STATE]
proof (prove)
using this:
one_dim_iso x *\<^sub>C f (1::'a) = one_dim_iso x *\<^sub>C g (1::'a)

goal (1 subgoal):
 1. f (1::'a) = g (1::'a)
[PROOF STEP]
using assms(1) one_dim_iso_of_zero'
[PROOF STATE]
proof (prove)
using this:
one_dim_iso x *\<^sub>C f (1::'a) = one_dim_iso x *\<^sub>C g (1::'a)
x \<noteq> (0::'a)
one_dim_iso ?x = (0::?'a) \<Longrightarrow> ?x = (0::?'b)

goal (1 subgoal):
 1. f (1::'a) = g (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f (1::'a) = g (1::'a)

goal (1 subgoal):
 1. \<And>x. f x = g x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f (1::'a) = g (1::'a)
[PROOF STEP]
show "f y = g y"
[PROOF STATE]
proof (prove)
using this:
f (1::'a) = g (1::'a)

goal (1 subgoal):
 1. f y = g y
[PROOF STEP]
by (metis assms(2) assms(3) complex_vector.linear_scale one_dim_scaleC_1)
[PROOF STATE]
proof (state)
this:
f y = g y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LNil_eq_lappend_iff:
  "LNil = lappend xs ys \<longleftrightarrow> xs = LNil \<and> ys = LNil"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LNil = lappend xs ys) = (xs = LNil \<and> ys = LNil)
[PROOF STEP]
by(auto dest: sym simp add: lappend_eq_LNil_iff)


[STATEMENT]
lemma fromCard_toCard:
  "\<lbrakk>|A| \<le>o r; Card_order r; b \<in> A\<rbrakk> \<Longrightarrow> fromCard A r (toCard A r b) = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>|A| \<le>o r; Card_order r; b \<in> A\<rbrakk> \<Longrightarrow> fromCard A r (toCard A r b) = b
[PROOF STEP]
unfolding fromCard_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>|A| \<le>o r; Card_order r; b \<in> A\<rbrakk> \<Longrightarrow> (SOME ba. ba \<in> A \<and> toCard A r ba = toCard A r b) = b
[PROOF STEP]
by (rule some_equality) (auto simp add: toCard_inj)


[STATEMENT]
lemma tendsto_at_top_iff: "(f \<longlongrightarrow> l) at_top \<longleftrightarrow> (\<forall>e>0. \<exists>x0. \<forall>x\<ge>x0. dist (f x) l < e)"
  for f::"'a::linorder_topology \<Rightarrow> 'b::metric_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> l) at_top = (\<forall>e>0. \<exists>x0. \<forall>x\<ge>x0. dist (f x) l < e)
[PROOF STEP]
by (auto intro!: tendsto_at_topI elim!: tendsto_at_topE)


[STATEMENT]
lemma finite_implies_discrete:
  fixes S :: "'a::topological_space set"
  assumes "finite (f ` S)"
  shows "(\<forall>x \<in> S. \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
have "\<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)" if "x \<in> S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
proof (cases "f ` S - {f x} = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` S - {f x} = {} \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
 2. f ` S - {f x} \<noteq> {} \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f ` S - {f x} = {}

goal (2 subgoals):
 1. f ` S - {f x} = {} \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
 2. f ` S - {f x} \<noteq> {} \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
with zero_less_numeral
[PROOF STATE]
proof (chain)
picking this:
(0::?'a) < numeral ?n
f ` S - {f x} = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0::?'a) < numeral ?n
f ` S - {f x} = {}

goal (1 subgoal):
 1. \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
by (fastforce simp add: Set.image_subset_iff cong: conj_cong)
[PROOF STATE]
proof (state)
this:
\<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)

goal (1 subgoal):
 1. f ` S - {f x} \<noteq> {} \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f ` S - {f x} \<noteq> {} \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f ` S - {f x} \<noteq> {}

goal (1 subgoal):
 1. f ` S - {f x} \<noteq> {} \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ` S - {f x} \<noteq> {}
[PROOF STEP]
obtain z where "z \<in> S" "f z \<noteq> f x"
[PROOF STATE]
proof (prove)
using this:
f ` S - {f x} \<noteq> {}

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z \<in> S; f z \<noteq> f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<in> S
f z \<noteq> f x

goal (1 subgoal):
 1. f ` S - {f x} \<noteq> {} \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<in> S
f z \<noteq> f x

goal (1 subgoal):
 1. f ` S - {f x} \<noteq> {} \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
have finn: "finite {norm (z - f x) |z. z \<in> f ` S - {f x}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {norm (z - f x) |z. z \<in> f ` S - {f x}}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (f ` S)

goal (1 subgoal):
 1. finite {norm (z - f x) |z. z \<in> f ` S - {f x}}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {norm (z - f x) |z. z \<in> f ` S - {f x}}

goal (1 subgoal):
 1. f ` S - {f x} \<noteq> {} \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<in> S
f z \<noteq> f x
finite {norm (z - f x) |z. z \<in> f ` S - {f x}}
[PROOF STEP]
have *: "0 < Inf{norm(z - f x) | z. z \<in> f ` S - {f x}}"
[PROOF STATE]
proof (prove)
using this:
z \<in> S
f z \<noteq> f x
finite {norm (z - f x) |z. z \<in> f ` S - {f x}}

goal (1 subgoal):
 1. 0 < Inf {norm (z - f x) |z. z \<in> f ` S - {f x}}
[PROOF STEP]
by (force intro: finite_imp_less_Inf)
[PROOF STATE]
proof (state)
this:
0 < Inf {norm (z - f x) |z. z \<in> f ` S - {f x}}

goal (1 subgoal):
 1. f ` S - {f x} \<noteq> {} \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
by (force intro!: * cInf_le_finite [OF finn])
[PROOF STATE]
proof (state)
this:
\<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f ?x \<longrightarrow> e \<le> norm (f y - f ?x)

goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite (f ` S)
?x \<in> S \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f ?x \<longrightarrow> e \<le> norm (f y - f ?x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (f ` S)
?x \<in> S \<Longrightarrow> \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f ?x \<longrightarrow> e \<le> norm (f y - f ?x)

goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. \<exists>e>0. \<forall>y. y \<in> S \<and> f y \<noteq> f x \<longrightarrow> e \<le> norm (f y - f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isomorphic_sum_integer_group:
   "sum_group I (\<lambda>i. integer_group) \<cong> free_Abelian_group I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_group I (\<lambda>i. integer_group) \<cong> free_Abelian_group I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_group I (\<lambda>i. integer_group) \<cong> free_Abelian_group I
[PROOF STEP]
have "sum_group I (\<lambda>i. integer_group) \<cong> sum_group I (\<lambda>i. free_Abelian_group {i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_group I (\<lambda>i. integer_group) \<cong> sum_group I (\<lambda>i. free_Abelian_group {i})
[PROOF STEP]
by (rule iso_sum_groupI) (auto simp: isomorphic_group_integer_free_Abelian_group_singleton)
[PROOF STATE]
proof (state)
this:
sum_group I (\<lambda>i. integer_group) \<cong> sum_group I (\<lambda>i. free_Abelian_group {i})

goal (1 subgoal):
 1. sum_group I (\<lambda>i. integer_group) \<cong> free_Abelian_group I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_group I (\<lambda>i. integer_group) \<cong> sum_group I (\<lambda>i. free_Abelian_group {i})

goal (1 subgoal):
 1. sum_group I (\<lambda>i. integer_group) \<cong> free_Abelian_group I
[PROOF STEP]
have "\<dots> \<cong> free_Abelian_group I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_group I (\<lambda>i. free_Abelian_group {i}) \<cong> free_Abelian_group I
[PROOF STEP]
using iso_free_Abelian_group_sum [of "\<lambda>x. {x}" I]
[PROOF STATE]
proof (prove)
using this:
pairwise (\<lambda>i j. disjnt {i} {j}) I \<Longrightarrow> (\<lambda>f. sum' f I) \<in> Group.iso (sum_group I (\<lambda>i. free_Abelian_group {i})) (free_Abelian_group (\<Union>x\<in>I. {x}))

goal (1 subgoal):
 1. sum_group I (\<lambda>i. free_Abelian_group {i}) \<cong> free_Abelian_group I
[PROOF STEP]
by (auto simp: is_iso_def)
[PROOF STATE]
proof (state)
this:
sum_group I (\<lambda>i. free_Abelian_group {i}) \<cong> free_Abelian_group I

goal (1 subgoal):
 1. sum_group I (\<lambda>i. integer_group) \<cong> free_Abelian_group I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_group I (\<lambda>i. integer_group) \<cong> free_Abelian_group I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_group I (\<lambda>i. integer_group) \<cong> free_Abelian_group I

goal (1 subgoal):
 1. sum_group I (\<lambda>i. integer_group) \<cong> free_Abelian_group I
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum_group I (\<lambda>i. integer_group) \<cong> free_Abelian_group I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powhr_divide: "\<And>a x y. 0 \<le> x \<Longrightarrow> 0 \<le> y \<Longrightarrow> (x / y) powhr a = (x powhr a) / (y powhr a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a x y. \<lbrakk>0 \<le> x; 0 \<le> y\<rbrakk> \<Longrightarrow> (x / y) powhr a = x powhr a / y powhr a
[PROOF STEP]
by transfer (rule powr_divide)


[STATEMENT]
lemma one_dim_positive: \<open>A \<ge> 0 \<longleftrightarrow> one_dim_iso A \<ge> (0::complex)\<close> for A :: \<open>'a \<Rightarrow>\<^sub>C\<^sub>L 'a::{chilbert_space, one_dim}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> A) = (0 \<le> one_dim_iso A)
[PROOF STEP]
using one_dim_loewner_order[where B=0]
[PROOF STATE]
proof (prove)
using this:
(0 \<le> ?A) = (one_dim_iso 0 \<le> one_dim_iso ?A)

goal (1 subgoal):
 1. (0 \<le> A) = (0 \<le> one_dim_iso A)
[PROOF STEP]
by auto


[STATEMENT]
lemma nr_mono_bind:
  assumes MA: "mono A" and MB: "\<And>s. mono (B s)"
  shows "mono (\<lambda>F s. bind (A F s) (\<lambda>s'. B s F s'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono (\<lambda>F s. A F s \<bind> B s F)
[PROOF STEP]
apply (rule monoI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. x \<le> y \<Longrightarrow> (\<lambda>s. A x s \<bind> B s x) \<le> (\<lambda>s. A y s \<bind> B s y)
[PROOF STEP]
apply (rule le_funI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y xa. x \<le> y \<Longrightarrow> A x xa \<bind> B xa x \<le> A y xa \<bind> B xa y
[PROOF STEP]
apply (rule bind_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y xa. x \<le> y \<Longrightarrow> A x xa \<le> A y xa
 2. \<And>x y xa xb. \<lbrakk>x \<le> y; RETURN xb \<le> A x xa\<rbrakk> \<Longrightarrow> B xa x xb \<le> B xa y xb
[PROOF STEP]
apply (auto dest: monoD[OF MA, THEN le_funD]) []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y xa xb. \<lbrakk>x \<le> y; RETURN xb \<le> A x xa\<rbrakk> \<Longrightarrow> B xa x xb \<le> B xa y xb
[PROOF STEP]
apply (auto dest: monoD[OF MB, THEN le_funD]) []
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma gcd_abs_mult_right_int [simp]:
  "gcd x (\<bar>a\<bar> * y) = gcd x (a * y)" for x y a :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd x (\<bar>a\<bar> * y) = gcd x (a * y)
[PROOF STEP]
using gcd_abs2_int [of _ "a * y"] gcd_abs2_int [of _ "\<bar>a\<bar> * y"]
[PROOF STATE]
proof (prove)
using this:
gcd ?x \<bar>a * y\<bar> = gcd ?x (a * y)
gcd ?x \<bar>\<bar>a\<bar> * y\<bar> = gcd ?x (\<bar>a\<bar> * y)

goal (1 subgoal):
 1. gcd x (\<bar>a\<bar> * y) = gcd x (a * y)
[PROOF STEP]
by (simp add: abs_mult)


[STATEMENT]
lemma eventually_uniformity_metric:
  "eventually P uniformity \<longleftrightarrow> (\<exists>e>0. \<forall>x y. dist x y < e \<longrightarrow> P (x, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P uniformity = (\<exists>e>0. \<forall>x y. dist x y < e \<longrightarrow> P (x, y))
[PROOF STEP]
unfolding uniformity_dist
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (INF e\<in>{0<..}. principal {(x, y). dist x y < e}) = (\<exists>e>0. \<forall>x y. dist x y < e \<longrightarrow> P (x, y))
[PROOF STEP]
by (subst eventually_INF_base)
     (auto simp: eventually_principal subset_eq intro: bexI[of _ "min _ _"])


[STATEMENT]
lemma is_lb_downward: "[|S >| l; y \<sqsubseteq> l|] ==> S >| y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S >| l; y \<sqsubseteq> l\<rbrakk> \<Longrightarrow> S >| y
[PROOF STEP]
unfolding is_lb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ball S ((\<sqsubseteq>) l); y \<sqsubseteq> l\<rbrakk> \<Longrightarrow> Ball S ((\<sqsubseteq>) y)
[PROOF STEP]
by (fast intro: below_trans)


[STATEMENT]
lemma least_map_insert_nmin:
    "\<lbrakk> x\<in>least_map f S; f x \<le> f a \<rbrakk> \<Longrightarrow> x\<in>least_map f (insert a S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> least_map f S; f x \<le> f a\<rbrakk> \<Longrightarrow> x \<in> least_map f (insert a S)
[PROOF STEP]
by (auto elim: least_map.cases intro: least_map.intros)


[STATEMENT]
lemma (in group_hom) inj_on_subgroup_iff_trivial_ker:
  assumes "subgroup I G"
  shows "inj_on h I \<longleftrightarrow> kernel (G \<lparr> carrier := I \<rparr>) H h = { \<one> }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on h I = (kernel (G\<lparr>carrier := I\<rparr>) H h = {\<one>})
[PROOF STEP]
using group_hom.inj_iff_trivial_ker[OF induced_group_hom'[OF assms]]
[PROOF STATE]
proof (prove)
using this:
inj_on h (carrier (G\<lparr>carrier := I\<rparr>)) = (kernel (G\<lparr>carrier := I\<rparr>) H h = {\<one>\<^bsub>G\<lparr>carrier := I\<rparr>\<^esub>})

goal (1 subgoal):
 1. inj_on h I = (kernel (G\<lparr>carrier := I\<rparr>) H h = {\<one>})
[PROOF STEP]
by simp


[STATEMENT]
lemma matrix_to_iarray_consistent[code]: "consistent A b = consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consistent A b = consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
unfolding consistent_eq_rank_ge_code
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (let GJ_P = Gauss_Jordan_PA A; P_mult_b = fst GJ_P *v b in Let (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd GJ_P) \<noteq> 0) + 1) ((\<le>) (if \<exists>a. P_mult_b $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. P_mult_b $ a \<noteq> (0::'a)) + 1 else 0))) = consistent_iarrays (matrix_to_iarray A) (vec_to_iarray b)
[PROOF STEP]
unfolding consistent_iarrays_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if \<exists>a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a)) + 1 else 0) \<le> (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd (Gauss_Jordan_PA A)) \<noteq> 0) + 1)) = ((if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))))))
[PROOF STEP]
unfolding Gauss_Jordan_PA_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if \<exists>a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a)) + 1 else 0) \<le> (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1)) = ((if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))))))
[PROOF STEP]
unfolding rank_Gauss_Jordan_code[symmetric, unfolded Let_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if \<exists>a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a)) + 1 else 0) \<le> rank A) = ((if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))))))
[PROOF STEP]
unfolding snd_Gauss_Jordan_iarrays_PA_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if \<exists>a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a)) + 1 else 0) \<le> rank A) = ((if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (Gauss_Jordan_iarrays (matrix_to_iarray A)))))
[PROOF STEP]
unfolding rank_iarrays_code[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if \<exists>a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a)) + 1 else 0) \<le> rank A) = ((if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> rank_iarray (matrix_to_iarray A))
[PROOF STEP]
unfolding matrix_to_iarray_rank
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if \<exists>a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a)) + 1 else 0) \<le> rank_iarray (matrix_to_iarray A)) = ((if \<not> is_zero_iarray (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) then greatest_not_zero (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)) *iv vec_to_iarray b) + 1 else 0) \<le> rank_iarray (matrix_to_iarray A))
[PROOF STEP]
unfolding matrix_to_iarray_fst_Gauss_Jordan_PA[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if \<exists>a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a)) + 1 else 0) \<le> rank_iarray (matrix_to_iarray A)) = ((if \<not> is_zero_iarray (matrix_to_iarray (fst (Gauss_Jordan_PA A)) *iv vec_to_iarray b) then greatest_not_zero (matrix_to_iarray (fst (Gauss_Jordan_PA A)) *iv vec_to_iarray b) + 1 else 0) \<le> rank_iarray (matrix_to_iarray A))
[PROOF STEP]
unfolding vec_to_iarray_matrix_matrix_mult[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if \<exists>a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a)) + 1 else 0) \<le> rank_iarray (matrix_to_iarray A)) = ((if \<not> is_zero_iarray (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b)) then greatest_not_zero (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b)) + 1 else 0) \<le> rank_iarray (matrix_to_iarray A))
[PROOF STEP]
unfolding not_is_zero_iarray_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if \<not> is_zero_iarray (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b)) then mod_type_class.to_nat (GREATEST a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a)) + 1 else 0) \<le> rank_iarray (matrix_to_iarray A)) = ((if \<not> is_zero_iarray (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b)) then greatest_not_zero (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b)) + 1 else 0) \<le> rank_iarray (matrix_to_iarray A))
[PROOF STEP]
using vec_to_iarray_greatest_not_zero[unfolded not_is_zero_iarray_eq_iff]
[PROOF STATE]
proof (prove)
using this:
\<not> is_zero_iarray (vec_to_iarray ?A) \<Longrightarrow> greatest_not_zero (vec_to_iarray ?A) = mod_type_class.to_nat (GREATEST b. ?A $ b \<noteq> (0::?'b))

goal (1 subgoal):
 1. ((if \<not> is_zero_iarray (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b)) then mod_type_class.to_nat (GREATEST a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a)) + 1 else 0) \<le> rank_iarray (matrix_to_iarray A)) = ((if \<not> is_zero_iarray (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b)) then greatest_not_zero (vec_to_iarray (fst (Gauss_Jordan_PA A) *v b)) + 1 else 0) \<le> rank_iarray (matrix_to_iarray A))
[PROOF STEP]
by force


[STATEMENT]
lemma ssorted_iff_mono: "ssorted s \<longleftrightarrow> (\<forall>i j. i \<le> j \<longrightarrow> s !! i \<le> s !! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ssorted s = (\<forall>i j. i \<le> j \<longrightarrow> s !! i \<le> s !! j)
[PROOF STEP]
using ssorted_monoI ssorted_monoD
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. i \<le> j \<longrightarrow> ?s !! i \<le> ?s !! j \<Longrightarrow> ssorted ?s
\<lbrakk>ssorted ?s; ?i \<le> ?j\<rbrakk> \<Longrightarrow> ?s !! ?i \<le> ?s !! ?j

goal (1 subgoal):
 1. ssorted s = (\<forall>i j. i \<le> j \<longrightarrow> s !! i \<le> s !! j)
[PROOF STEP]
by metis


[STATEMENT]
lemma ex_norm1:
  assumes \<open>(UNIV::'a::real_normed_vector set) \<noteq> {0}\<close>
  shows \<open>\<exists>x::'a. norm x = 1\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. norm x = 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. norm x = 1
[PROOF STEP]
have \<open>\<exists>x::'a. x \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. x \<noteq> (0::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
UNIV \<noteq> {0::'a}

goal (1 subgoal):
 1. \<exists>x. x \<noteq> (0::'a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>x. x \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>x. norm x = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. x \<noteq> (0::'a)
[PROOF STEP]
obtain x::'a where \<open>x \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>x. x \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<And>x. x \<noteq> (0::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>x. norm x = 1
[PROOF STEP]
hence \<open>norm x \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. norm x \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm x \<noteq> 0

goal (1 subgoal):
 1. \<exists>x. norm x = 1
[PROOF STEP]
hence \<open>(norm x) / (norm x) = 1\<close>
[PROOF STATE]
proof (prove)
using this:
norm x \<noteq> 0

goal (1 subgoal):
 1. norm x / norm x = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm x / norm x = 1

goal (1 subgoal):
 1. \<exists>x. norm x = 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
norm x / norm x = 1

goal (1 subgoal):
 1. \<exists>x. norm x = 1
[PROOF STEP]
have \<open>(norm x) / (norm x) = norm (x /\<^sub>R (norm x))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x / norm x = norm (x /\<^sub>R norm x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm x / norm x = norm (x /\<^sub>R norm x)

goal (1 subgoal):
 1. \<exists>x. norm x = 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
norm x / norm x = 1
norm x / norm x = norm (x /\<^sub>R norm x)
[PROOF STEP]
have \<open>norm (x /\<^sub>R (norm x)) = 1\<close>
[PROOF STATE]
proof (prove)
using this:
norm x / norm x = 1
norm x / norm x = norm (x /\<^sub>R norm x)

goal (1 subgoal):
 1. norm (x /\<^sub>R norm x) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (x /\<^sub>R norm x) = 1

goal (1 subgoal):
 1. \<exists>x. norm x = 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (x /\<^sub>R norm x) = 1

goal (1 subgoal):
 1. \<exists>x. norm x = 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x. norm x = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_mult_not_eq_zero_sumI:
  fixes f g :: "'a::monoid_add \<Rightarrow> 'b::semiring_0"
  assumes "finite {a. f a \<noteq> 0}"
  assumes "finite {b. g b \<noteq> 0}"
  shows "finite {a + b | a b. f a * g b \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {a + b |a b. f a * g b \<noteq> (0::'b)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {a + b |a b. f a * g b \<noteq> (0::'b)}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite {a. f a \<noteq> (0::'b)}
finite {b. g b \<noteq> (0::'b)}
[PROOF STEP]
have "finite {a + b | a b. f a \<noteq> 0 \<and> g b \<noteq> 0}"
[PROOF STATE]
proof (prove)
using this:
finite {a. f a \<noteq> (0::'b)}
finite {b. g b \<noteq> (0::'b)}

goal (1 subgoal):
 1. finite {a + b |a b. f a \<noteq> (0::'b) \<and> g b \<noteq> (0::'b)}
[PROOF STEP]
by (rule finite_not_eq_zero_sumI)
[PROOF STATE]
proof (state)
this:
finite {a + b |a b. f a \<noteq> (0::'b) \<and> g b \<noteq> (0::'b)}

goal (1 subgoal):
 1. finite {a + b |a b. f a * g b \<noteq> (0::'b)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {a + b |a b. f a \<noteq> (0::'b) \<and> g b \<noteq> (0::'b)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {a + b |a b. f a \<noteq> (0::'b) \<and> g b \<noteq> (0::'b)}

goal (1 subgoal):
 1. finite {a + b |a b. f a * g b \<noteq> (0::'b)}
[PROOF STEP]
by (rule rev_finite_subset) (auto dest: mult_not_zero)
[PROOF STATE]
proof (state)
this:
finite {a + b |a b. f a * g b \<noteq> (0::'b)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_bound_le:
  assumes "x \<le> a" and "y \<le> a" and "0 \<le> u" and "0 \<le> v" and "u + v = 1"
  shows "u * x + v * y \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u * x + v * y \<le> a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u * x + v * y \<le> a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<le> a
y \<le> a
(0::'a) \<le> u
(0::'a) \<le> v
u + v = (1::'a)
[PROOF STEP]
have "u * x + v * y \<le> u * a + v * a"
[PROOF STATE]
proof (prove)
using this:
x \<le> a
y \<le> a
(0::'a) \<le> u
(0::'a) \<le> v
u + v = (1::'a)

goal (1 subgoal):
 1. u * x + v * y \<le> u * a + v * a
[PROOF STEP]
by (simp add: add_mono mult_left_mono)
[PROOF STATE]
proof (state)
this:
u * x + v * y \<le> u * a + v * a

goal (1 subgoal):
 1. u * x + v * y \<le> a
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
x \<le> a
y \<le> a
(0::'a) \<le> u
(0::'a) \<le> v
u + v = (1::'a)
u * x + v * y \<le> u * a + v * a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<le> a
y \<le> a
(0::'a) \<le> u
(0::'a) \<le> v
u + v = (1::'a)
u * x + v * y \<le> u * a + v * a

goal (1 subgoal):
 1. u * x + v * y \<le> a
[PROOF STEP]
unfolding distrib_right[symmetric]
[PROOF STATE]
proof (prove)
using this:
x \<le> a
y \<le> a
(0::'a) \<le> u
(0::'a) \<le> v
u + v = (1::'a)
u * x + v * y \<le> (u + v) * a

goal (1 subgoal):
 1. u * x + v * y \<le> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u * x + v * y \<le> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vsv_image_vsubset_iff:
  "r `\<^sub>\<circ> A \<subseteq>\<^sub>\<circ> B \<longleftrightarrow> (\<forall>a\<in>\<^sub>\<circ>A. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> r \<longrightarrow> r\<lparr>a\<rparr> \<in>\<^sub>\<circ> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r `\<^sub>\<circ> A \<subseteq>\<^sub>\<circ> B) = (\<forall>a\<in>elts A. a \<in>\<^sub>\<circ> \<D>\<^sub>\<circ> r \<longrightarrow> r\<lparr>a\<rparr> \<in>\<^sub>\<circ> B)
[PROOF STEP]
by (auto simp: vsv_vimage_iff)


[STATEMENT]
lemma conesegment_commute: "conesegment a b = conesegment b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conesegment a b = conesegment b a
[PROOF STEP]
apply (auto simp: conesegment_def )
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. \<lbrakk>0 \<le> xa; xa * 2 \<le> pi\<rbrakk> \<Longrightarrow> conemem a b xa \<in> conemem b a ` {0..pi / 2}
 2. \<And>xa. \<lbrakk>0 \<le> xa; xa * 2 \<le> pi\<rbrakk> \<Longrightarrow> conemem b a xa \<in> conemem a b ` {0..pi / 2}
[PROOF STEP]
apply (subst conemem_commute)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>xa. \<lbrakk>0 \<le> xa; xa * 2 \<le> pi\<rbrakk> \<Longrightarrow> 0 \<le> xa
 2. \<And>xa. \<lbrakk>0 \<le> xa; xa * 2 \<le> pi\<rbrakk> \<Longrightarrow> xa \<le> pi / 2
 3. \<And>xa. \<lbrakk>0 \<le> xa; xa * 2 \<le> pi\<rbrakk> \<Longrightarrow> conemem b a (pi / 2 - xa) \<in> conemem b a ` {0..pi / 2}
 4. \<And>xa. \<lbrakk>0 \<le> xa; xa * 2 \<le> pi\<rbrakk> \<Longrightarrow> conemem b a xa \<in> conemem a b ` {0..pi / 2}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>0 \<le> xa; xa * 2 \<le> pi\<rbrakk> \<Longrightarrow> conemem b a xa \<in> conemem a b ` {0..pi / 2}
[PROOF STEP]
apply (subst conemem_commute)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>xa. \<lbrakk>0 \<le> xa; xa * 2 \<le> pi\<rbrakk> \<Longrightarrow> 0 \<le> xa
 2. \<And>xa. \<lbrakk>0 \<le> xa; xa * 2 \<le> pi\<rbrakk> \<Longrightarrow> xa \<le> pi / 2
 3. \<And>xa. \<lbrakk>0 \<le> xa; xa * 2 \<le> pi\<rbrakk> \<Longrightarrow> conemem a b (pi / 2 - xa) \<in> conemem a b ` {0..pi / 2}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cpx_pos_square_pos:
  fixes z::complex
  assumes "0 \<le> z"
  shows "0 \<le> z\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> z\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> z\<^sup>2
[PROOF STEP]
have "Im z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im z = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> z

goal (1 subgoal):
 1. Im z = 0
[PROOF STEP]
by (simp add: complex_positive_Im)
[PROOF STATE]
proof (state)
this:
Im z = 0

goal (1 subgoal):
 1. 0 \<le> z\<^sup>2
[PROOF STEP]
hence "Re (z\<^sup>2) = (Re z)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
Im z = 0

goal (1 subgoal):
 1. Re (z\<^sup>2) = (Re z)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Re (z\<^sup>2) = (Re z)\<^sup>2

goal (1 subgoal):
 1. 0 \<le> z\<^sup>2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re (z\<^sup>2) = (Re z)\<^sup>2

goal (1 subgoal):
 1. 0 \<le> z\<^sup>2
[PROOF STEP]
have "Im (z\<^sup>2) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (z\<^sup>2) = 0
[PROOF STEP]
by (simp add: \<open>Im z = 0\<close>)
[PROOF STATE]
proof (state)
this:
Im (z\<^sup>2) = 0

goal (1 subgoal):
 1. 0 \<le> z\<^sup>2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Re (z\<^sup>2) = (Re z)\<^sup>2
Im (z\<^sup>2) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (z\<^sup>2) = (Re z)\<^sup>2
Im (z\<^sup>2) = 0

goal (1 subgoal):
 1. 0 \<le> z\<^sup>2
[PROOF STEP]
by (simp add: less_eq_complex_def)
[PROOF STATE]
proof (state)
this:
0 \<le> z\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj2_line_through_incident:
  shows "proj2_incident p (proj2_line_through p q)"
  and "proj2_incident q (proj2_line_through p q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_incident p (proj2_line_through p q) &&& proj2_incident q (proj2_line_through p q)
[PROOF STEP]
unfolding proj2_line_through_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_incident p (SOME l. proj2_incident p l \<and> proj2_incident q l) &&& proj2_incident q (SOME l. proj2_incident p l \<and> proj2_incident q l)
[PROOF STEP]
using proj2_points_define_line
    and someI_ex [of "\<lambda> l. proj2_incident p l \<and> proj2_incident q l"]
[PROOF STATE]
proof (prove)
using this:
\<exists>l. proj2_incident ?p l \<and> proj2_incident ?q l
\<exists>x. proj2_incident p x \<and> proj2_incident q x \<Longrightarrow> proj2_incident p (SOME x. proj2_incident p x \<and> proj2_incident q x) \<and> proj2_incident q (SOME x. proj2_incident p x \<and> proj2_incident q x)

goal (1 subgoal):
 1. proj2_incident p (SOME l. proj2_incident p l \<and> proj2_incident q l) &&& proj2_incident q (SOME l. proj2_incident p l \<and> proj2_incident q l)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma B_consistent_prfOf_iff_PPf:
"B.consistent \<Longrightarrow> prf \<in> proof \<Longrightarrow> \<phi> \<in> fmla \<Longrightarrow> Fvars \<phi> = {} \<longrightarrow> prfOf prf \<phi> \<longleftrightarrow> bprv (PPf (encPf prf) \<langle>\<phi>\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>B.consistent; prf \<in> proof; \<phi> \<in> fmla\<rbrakk> \<Longrightarrow> Fvars \<phi> = {} \<longrightarrow> prfOf prf \<phi> = bprv (PPf (encPf prf) \<langle>\<phi>\<rangle>)
[PROOF STEP]
unfolding B.consistent_def3
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>\<phi>\<in>fmla. \<not> (bprv \<phi> \<and> bprv (neg \<phi>)); prf \<in> proof; \<phi> \<in> fmla\<rbrakk> \<Longrightarrow> Fvars \<phi> = {} \<longrightarrow> prfOf prf \<phi> = bprv (PPf (encPf prf) \<langle>\<phi>\<rangle>)
[PROOF STEP]
using not_prfOf_PPf[of "prf" \<phi>] prfOf_PPf[of "prf" \<phi>]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prf \<in> proof; \<phi> \<in> fmla; Fvars \<phi> = {}; \<not> prfOf prf \<phi>\<rbrakk> \<Longrightarrow> bprv (neg (PPf (encPf prf) \<langle>\<phi>\<rangle>))
\<lbrakk>prf \<in> proof; \<phi> \<in> fmla; Fvars \<phi> = {}; prfOf prf \<phi>\<rbrakk> \<Longrightarrow> bprv (PPf (encPf prf) \<langle>\<phi>\<rangle>)

goal (1 subgoal):
 1. \<lbrakk>\<forall>\<phi>\<in>fmla. \<not> (bprv \<phi> \<and> bprv (neg \<phi>)); prf \<in> proof; \<phi> \<in> fmla\<rbrakk> \<Longrightarrow> Fvars \<phi> = {} \<longrightarrow> prfOf prf \<phi> = bprv (PPf (encPf prf) \<langle>\<phi>\<rangle>)
[PROOF STEP]
by force


[STATEMENT]
lemma emeasure_UN_countable:
  assumes sets[measurable]: "\<And>i. i \<in> I \<Longrightarrow> X i \<in> sets M" and I[simp]: "countable I"
  assumes disj: "disjoint_family_on X I"
  shows "emeasure M (\<Union>(X ` I)) = (\<integral>\<^sup>+i. emeasure M (X i) \<partial>count_space I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (\<Union> (X ` I)) = \<integral>\<^sup>+ i. emeasure M (X i) \<partial>count_space I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure M (\<Union> (X ` I)) = \<integral>\<^sup>+ i. emeasure M (X i) \<partial>count_space I
[PROOF STEP]
have eq: "\<And>x. indicator (\<Union>(X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. ?P x \<Longrightarrow> indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
 2. \<And>x. \<not> ?P x \<Longrightarrow> indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. ?P x \<Longrightarrow> indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
 2. \<And>x. \<not> ?P x \<Longrightarrow> indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
[PROOF STEP]
assume x: "x \<in> \<Union>(X ` I)"
[PROOF STATE]
proof (state)
this:
x \<in> \<Union> (X ` I)

goal (2 subgoals):
 1. \<And>x. ?P x \<Longrightarrow> indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
 2. \<And>x. \<not> ?P x \<Longrightarrow> indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<Union> (X ` I)
[PROOF STEP]
obtain j where j: "x \<in> X j" "j \<in> I"
[PROOF STATE]
proof (prove)
using this:
x \<in> \<Union> (X ` I)

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>x \<in> X j; j \<in> I\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> X j
j \<in> I

goal (2 subgoals):
 1. \<And>x. ?P x \<Longrightarrow> indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
 2. \<And>x. \<not> ?P x \<Longrightarrow> indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
[PROOF STEP]
with disj
[PROOF STATE]
proof (chain)
picking this:
disjoint_family_on X I
x \<in> X j
j \<in> I
[PROOF STEP]
have "\<And>i. i \<in> I \<Longrightarrow> indicator (X i) x = (indicator {j} i::ennreal)"
[PROOF STATE]
proof (prove)
using this:
disjoint_family_on X I
x \<in> X j
j \<in> I

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> indicator (X i) x = indicator {j} i
[PROOF STEP]
by (auto simp: disjoint_family_on_def split: split_indicator)
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> indicator (X ?i) x = indicator {j} ?i

goal (2 subgoals):
 1. \<And>x. ?P x \<Longrightarrow> indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
 2. \<And>x. \<not> ?P x \<Longrightarrow> indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
[PROOF STEP]
with x j
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<Union> (X ` I)
x \<in> X j
j \<in> I
?i \<in> I \<Longrightarrow> indicator (X ?i) x = indicator {j} ?i
[PROOF STEP]
show "?thesis x"
[PROOF STATE]
proof (prove)
using this:
x \<in> \<Union> (X ` I)
x \<in> X j
j \<in> I
?i \<in> I \<Longrightarrow> indicator (X ?i) x = indicator {j} ?i

goal (1 subgoal):
 1. indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
[PROOF STEP]
by (simp cong: nn_integral_cong_simp)
[PROOF STATE]
proof (state)
this:
indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I

goal (1 subgoal):
 1. \<And>x. x \<notin> \<Union> (X ` I) \<Longrightarrow> indicator (\<Union> (X ` I)) x = \<integral>\<^sup>+ i. indicator (X i) x \<partial>count_space I
[PROOF STEP]
qed (auto simp: nn_integral_0_iff_AE)
[PROOF STATE]
proof (state)
this:
indicator (\<Union> (X ` I)) ?x = \<integral>\<^sup>+ i. indicator (X i) ?x \<partial>count_space I

goal (1 subgoal):
 1. emeasure M (\<Union> (X ` I)) = \<integral>\<^sup>+ i. emeasure M (X i) \<partial>count_space I
[PROOF STEP]
note sets.countable_UN'[unfolded subset_eq, measurable]
[PROOF STATE]
proof (state)
this:
\<lbrakk>countable ?X; \<forall>x\<in>?A ` ?X. x \<in> sets ?M\<rbrakk> \<Longrightarrow> \<Union> (?A ` ?X) \<in> sets ?M

goal (1 subgoal):
 1. emeasure M (\<Union> (X ` I)) = \<integral>\<^sup>+ i. emeasure M (X i) \<partial>count_space I
[PROOF STEP]
have "emeasure M (\<Union>(X ` I)) = (\<integral>\<^sup>+x. indicator (\<Union>(X ` I)) x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (\<Union> (X ` I)) = integral\<^sup>N M (indicator (\<Union> (X ` I)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
emeasure M (\<Union> (X ` I)) = integral\<^sup>N M (indicator (\<Union> (X ` I)))

goal (1 subgoal):
 1. emeasure M (\<Union> (X ` I)) = \<integral>\<^sup>+ i. emeasure M (X i) \<partial>count_space I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M (\<Union> (X ` I)) = integral\<^sup>N M (indicator (\<Union> (X ` I)))

goal (1 subgoal):
 1. emeasure M (\<Union> (X ` I)) = \<integral>\<^sup>+ i. emeasure M (X i) \<partial>count_space I
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+i. \<integral>\<^sup>+x. indicator (X i) x \<partial>M \<partial>count_space I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M (indicator (\<Union> (X ` I))) = \<integral>\<^sup>+ i. integral\<^sup>N M (indicator (X i)) \<partial>count_space I
[PROOF STEP]
by (simp add: eq nn_integral_count_space_nn_integral)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (indicator (\<Union> (X ` I))) = \<integral>\<^sup>+ i. integral\<^sup>N M (indicator (X i)) \<partial>count_space I

goal (1 subgoal):
 1. emeasure M (\<Union> (X ` I)) = \<integral>\<^sup>+ i. emeasure M (X i) \<partial>count_space I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure M (\<Union> (X ` I)) = \<integral>\<^sup>+ i. integral\<^sup>N M (indicator (X i)) \<partial>count_space I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure M (\<Union> (X ` I)) = \<integral>\<^sup>+ i. integral\<^sup>N M (indicator (X i)) \<partial>count_space I

goal (1 subgoal):
 1. emeasure M (\<Union> (X ` I)) = \<integral>\<^sup>+ i. emeasure M (X i) \<partial>count_space I
[PROOF STEP]
by (simp cong: nn_integral_cong_simp)
[PROOF STATE]
proof (state)
this:
emeasure M (\<Union> (X ` I)) = \<integral>\<^sup>+ i. emeasure M (X i) \<partial>count_space I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  orthogonal_transformation_exists_1:
  fixes a b :: "real^'n"
  assumes "norm a = 1" "norm b = 1"
  obtains f where "orthogonal_transformation f" "f a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>orthogonal_transformation f; f a = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>orthogonal_transformation f; f a = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain k::'n where True
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (True \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
True

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>orthogonal_transformation f; f a = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain A B where AB: "orthogonal_matrix A" "orthogonal_matrix B" and eq: "A *v (axis k 1) = a" "B *v (axis k 1) = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A B. \<lbrakk>orthogonal_matrix A; orthogonal_matrix B; A *v axis k 1 = a; B *v axis k 1 = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using orthogonal_matrix_exists_basis assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>norm ?a = 1; \<And>A. \<lbrakk>orthogonal_matrix A; A *v axis ?k 1 = ?a\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
norm a = 1
norm b = 1

goal (1 subgoal):
 1. (\<And>A B. \<lbrakk>orthogonal_matrix A; orthogonal_matrix B; A *v axis k 1 = a; B *v axis k 1 = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
orthogonal_matrix A
orthogonal_matrix B
A *v axis k 1 = a
B *v axis k 1 = b

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>orthogonal_transformation f; f a = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?f = "\<lambda>x. (B ** transpose A) *v x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>orthogonal_transformation f; f a = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. orthogonal_transformation ?f
 2. ?f a = b
[PROOF STEP]
show "orthogonal_transformation ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal_transformation ((*v) (B ** Finite_Cartesian_Product.transpose A))
[PROOF STEP]
by (subst orthogonal_transformation_matrix)
        (auto simp: AB orthogonal_matrix_mul)
[PROOF STATE]
proof (state)
this:
orthogonal_transformation ((*v) (B ** Finite_Cartesian_Product.transpose A))

goal (1 subgoal):
 1. B ** Finite_Cartesian_Product.transpose A *v a = b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B ** Finite_Cartesian_Product.transpose A *v a = b
[PROOF STEP]
show "?f a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B ** Finite_Cartesian_Product.transpose A *v a = b
[PROOF STEP]
using \<open>orthogonal_matrix A\<close>
[PROOF STATE]
proof (prove)
using this:
orthogonal_matrix A

goal (1 subgoal):
 1. B ** Finite_Cartesian_Product.transpose A *v a = b
[PROOF STEP]
unfolding orthogonal_matrix_def
[PROOF STATE]
proof (prove)
using this:
Finite_Cartesian_Product.transpose A ** A = mat 1 \<and> A ** Finite_Cartesian_Product.transpose A = mat 1

goal (1 subgoal):
 1. B ** Finite_Cartesian_Product.transpose A *v a = b
[PROOF STEP]
by (metis eq matrix_mul_rid matrix_vector_mul_assoc)
[PROOF STATE]
proof (state)
this:
B ** Finite_Cartesian_Product.transpose A *v a = b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree0_inc_edges_empt_iff:
  assumes "finite E"
  shows "degree v = 0 \<longleftrightarrow> incident_edges v = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (degree v = 0) = (incident_edges v = {})
[PROOF STEP]
proof (intro iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree v = 0 \<Longrightarrow> incident_edges v = {}
 2. incident_edges v = {} \<Longrightarrow> degree v = 0
[PROOF STEP]
assume "degree v = 0"
[PROOF STATE]
proof (state)
this:
degree v = 0

goal (2 subgoals):
 1. degree v = 0 \<Longrightarrow> incident_edges v = {}
 2. incident_edges v = {} \<Longrightarrow> degree v = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree v = 0
[PROOF STEP]
have "card (incident_sedges v) + 2 * (card (incident_loops v)) = 0"
[PROOF STATE]
proof (prove)
using this:
degree v = 0

goal (1 subgoal):
 1. card (incident_sedges v) + 2 * card (incident_loops v) = 0
[PROOF STEP]
using degree_def
[PROOF STATE]
proof (prove)
using this:
degree v = 0
degree ?v \<equiv> card (incident_sedges ?v) + 2 * card (incident_loops ?v)

goal (1 subgoal):
 1. card (incident_sedges v) + 2 * card (incident_loops v) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (incident_sedges v) + 2 * card (incident_loops v) = 0

goal (2 subgoals):
 1. degree v = 0 \<Longrightarrow> incident_edges v = {}
 2. incident_edges v = {} \<Longrightarrow> degree v = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (incident_sedges v) + 2 * card (incident_loops v) = 0
[PROOF STEP]
have "incident_sedges v = {}" and "incident_loops v = {}"
[PROOF STATE]
proof (prove)
using this:
card (incident_sedges v) + 2 * card (incident_loops v) = 0

goal (1 subgoal):
 1. incident_sedges v = {} &&& incident_loops v = {}
[PROOF STEP]
using degree_def incident_edges_union assms finite_incident_edges finite_incident_loops
[PROOF STATE]
proof (prove)
using this:
card (incident_sedges v) + 2 * card (incident_loops v) = 0
degree ?v \<equiv> card (incident_sedges ?v) + 2 * card (incident_loops ?v)
incident_edges ?v = incident_sedges ?v \<union> incident_loops ?v
finite E
finite E \<Longrightarrow> finite (incident_edges ?v)
finite (incident_loops ?v)

goal (1 subgoal):
 1. incident_sedges v = {} &&& incident_loops v = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
incident_sedges v = {}
incident_loops v = {}

goal (2 subgoals):
 1. degree v = 0 \<Longrightarrow> incident_edges v = {}
 2. incident_edges v = {} \<Longrightarrow> degree v = 0
[PROOF STEP]
thus "incident_edges v = {}"
[PROOF STATE]
proof (prove)
using this:
incident_sedges v = {}
incident_loops v = {}

goal (1 subgoal):
 1. incident_edges v = {}
[PROOF STEP]
using incident_edges_union
[PROOF STATE]
proof (prove)
using this:
incident_sedges v = {}
incident_loops v = {}
incident_edges ?v = incident_sedges ?v \<union> incident_loops ?v

goal (1 subgoal):
 1. incident_edges v = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
incident_edges v = {}

goal (1 subgoal):
 1. incident_edges v = {} \<Longrightarrow> degree v = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. incident_edges v = {} \<Longrightarrow> degree v = 0
[PROOF STEP]
show "incident_edges v = {} \<Longrightarrow> degree v = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incident_edges v = {} \<Longrightarrow> degree v = 0
[PROOF STEP]
using incident_edges_union degree_def
[PROOF STATE]
proof (prove)
using this:
incident_edges ?v = incident_sedges ?v \<union> incident_loops ?v
degree ?v \<equiv> card (incident_sedges ?v) + 2 * card (incident_loops ?v)

goal (1 subgoal):
 1. incident_edges v = {} \<Longrightarrow> degree v = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
incident_edges v = {} \<Longrightarrow> degree v = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_open_segment [iff]: "convex (open_segment a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex (open_segment a b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convex (open_segment a b)
[PROOF STEP]
have "convex ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})
[PROOF STEP]
by (rule convex_linear_image) auto
[PROOF STATE]
proof (state)
this:
convex ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})

goal (1 subgoal):
 1. convex (open_segment a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
convex ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})
[PROOF STEP]
have "convex ((+) a ` (\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})"
[PROOF STATE]
proof (prove)
using this:
convex ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})

goal (1 subgoal):
 1. convex ((+) a ` (\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})
[PROOF STEP]
by (rule convex_translation)
[PROOF STATE]
proof (state)
this:
convex ((+) a ` (\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})

goal (1 subgoal):
 1. convex (open_segment a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
convex ((+) a ` (\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
convex ((+) a ` (\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})

goal (1 subgoal):
 1. convex (open_segment a b)
[PROOF STEP]
by (simp add: image_image open_segment_image_interval segment_eq_compose field_simps scaleR_diff_left scaleR_diff_right)
[PROOF STATE]
proof (state)
this:
convex (open_segment a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma g_nonneg': "eventually (\<lambda>x. g x \<ge> 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. 0 \<le> g x
[PROOF STEP]
using g_nonneg
[PROOF STATE]
proof (prove)
using this:
x\<^sub>1 \<le> ?x \<Longrightarrow> 0 \<le> g ?x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. 0 \<le> g x
[PROOF STEP]
by (force simp: eventually_at_top_linorder)


[STATEMENT]
lemma T_thm_1_glb: "glb P cl = glb {x \<in> A. (f x, x) \<in> r} cl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. glb P cl = glb {x \<in> A. (f x, x) \<in> r} cl
[PROOF STEP]
unfolding glb_dual_lub P_def A_def r_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lub (fix f (pset cl)) (dual cl) = lub {x \<in> pset cl. (f x, x) \<in> order cl} (dual cl)
[PROOF STEP]
using CLF.T_thm_1_lub dualA_iff dualr_iff local.dual
[PROOF STATE]
proof (prove)
using this:
CLF ?cl ?f \<Longrightarrow> lub (fix ?f (pset ?cl)) ?cl = lub {x \<in> pset ?cl. (x, ?f x) \<in> order ?cl} ?cl
pset (dual cl) = pset cl
((?x, ?y) \<in> order (dual cl)) = ((?y, ?x) \<in> order cl)
CLF (dual cl) f

goal (1 subgoal):
 1. lub (fix f (pset cl)) (dual cl) = lub {x \<in> pset cl. (f x, x) \<in> order cl} (dual cl)
[PROOF STEP]
by force


[STATEMENT]
lemma Not_Rex: "\<turnstile> (\<not>(\<exists> x. F x)) = (\<forall> x. \<not>F x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<not> (\<exists>x. F x) = (\<forall>x. \<not> F x)
[PROOF STEP]
by auto


[STATEMENT]
lemma ln_realpow: "0 < x \<Longrightarrow> ln (x^n) = real n * ln x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ln (x ^ n) = real n * ln x
[PROOF STEP]
by (rule ln_unique) (simp add: exp_of_nat_mult)


[STATEMENT]
lemma left_unique_rel_converter:
  "\<lbrakk> left_total A; left_unique B; left_unique C; left_total R \<rbrakk> \<Longrightarrow> left_unique (rel_converter A B C R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>left_total A; left_unique B; left_unique C; left_total R\<rbrakk> \<Longrightarrow> left_unique (rel_converter A B C R)
[PROOF STEP]
unfolding left_unique_alt_def left_total_alt_def rel_converter_conversep[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(=) \<le> A OO A\<inverse>\<inverse>; B OO B\<inverse>\<inverse> \<le> (=); C OO C\<inverse>\<inverse> \<le> (=); (=) \<le> R OO R\<inverse>\<inverse>\<rbrakk> \<Longrightarrow> rel_converter A B C R OO rel_converter A\<inverse>\<inverse> B\<inverse>\<inverse> C\<inverse>\<inverse> R\<inverse>\<inverse> \<le> (=)
[PROOF STEP]
by(subst rel_converter_eq[symmetric], rule order_trans[OF rel_converter_pos_distr], erule (3) rel_converter_mono)


[STATEMENT]
lemma clinear_tensor_right[simp]: \<open>clinear (\<lambda>b. a \<otimes>\<^sub>o b :: _::finite ell2 \<Rightarrow>\<^sub>C\<^sub>L _::finite ell2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clinear ((\<otimes>\<^sub>o) a)
[PROOF STEP]
apply (rule clinearI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b1 b2. a \<otimes>\<^sub>o (b1 + b2) = a \<otimes>\<^sub>o b1 + a \<otimes>\<^sub>o b2
 2. \<And>r b. a \<otimes>\<^sub>o r *\<^sub>C b = r *\<^sub>C (a \<otimes>\<^sub>o b)
[PROOF STEP]
apply (rule tensor_op_right_add)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r b. a \<otimes>\<^sub>o r *\<^sub>C b = r *\<^sub>C (a \<otimes>\<^sub>o b)
[PROOF STEP]
by (rule tensor_op_scaleC_right)


[STATEMENT]
theorem msetext_huet_eq_dersh: "irreflp gt \<Longrightarrow> transp gt \<Longrightarrow> msetext_dersh gt = msetext_huet gt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>irreflp gt; transp gt\<rbrakk> \<Longrightarrow> msetext_dersh gt = msetext_huet gt
[PROOF STEP]
using msetext_huet_imp_dersh msetext_dersh_imp_mult mult_imp_msetext_huet
[PROOF STATE]
proof (prove)
using this:
msetext_huet ?gt ?ys ?xs \<Longrightarrow> msetext_dersh ?gt ?ys ?xs
msetext_dersh ?gt ?ys ?xs \<Longrightarrow> (mset ?xs, mset ?ys) \<in> mult {(x, y). ?gt y x}
\<lbrakk>irreflp ?gt; transp ?gt; (mset ?xs, mset ?ys) \<in> mult {(x, y). ?gt y x}\<rbrakk> \<Longrightarrow> msetext_huet ?gt ?ys ?xs

goal (1 subgoal):
 1. \<lbrakk>irreflp gt; transp gt\<rbrakk> \<Longrightarrow> msetext_dersh gt = msetext_huet gt
[PROOF STEP]
by fast


[STATEMENT]
lemma Lim_component_eq_cart:
  fixes f :: "'a \<Rightarrow> real^'n"
  assumes net: "(f \<longlongrightarrow> l) net" "\<not> trivial_limit net" and ev:"eventually (\<lambda>x. f(x)$i = b) net"
  shows "l$i = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l $ i = b
[PROOF STEP]
using ev[unfolded order_eq_iff eventually_conj_iff] and
    Lim_component_ge_cart[OF net, of b i] and
    Lim_component_le_cart[OF net, of i b]
[PROOF STATE]
proof (prove)
using this:
(\<forall>\<^sub>F x in net. f x $ i \<le> b) \<and> (\<forall>\<^sub>F x in net. b \<le> f x $ i)
\<forall>\<^sub>F x in net. b \<le> f x $ i \<Longrightarrow> b \<le> l $ i
\<forall>\<^sub>F x in net. f x $ i \<le> b \<Longrightarrow> l $ i \<le> b

goal (1 subgoal):
 1. l $ i = b
[PROOF STEP]
by auto


[STATEMENT]
lemma add_diff_add: "(a + c) - (b + d) = (a - b) + (c - d)"
  for a b c d :: "'a::ab_group_add"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + c - (b + d) = a - b + (c - d)
[PROOF STEP]
by simp


[STATEMENT]
lemma "!!a::real. a + b \<le> i + j ==> a \<le> b ==> i \<le> j ==> a + a \<le> j + j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a + b \<le> i + j; a \<le> b; i \<le> j\<rbrakk> \<Longrightarrow> a + a \<le> j + j
[PROOF STEP]
by linarith


[STATEMENT]
lemma norm_powr_real_mono:
    "\<lbrakk>w \<in> \<real>; 1 < Re w\<rbrakk>
     \<Longrightarrow> cmod(w powr z1) \<le> cmod(w powr z2) \<longleftrightarrow> Re z1 \<le> Re z2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w \<in> \<real>; 1 < Re w\<rbrakk> \<Longrightarrow> (cmod (w powr z1) \<le> cmod (w powr z2)) = (Re z1 \<le> Re z2)
[PROOF STEP]
by (auto simp: powr_def algebra_simps Reals_def Ln_of_real)


[STATEMENT]
lemma (in semiring_1) zero_power_iff: "0 ^ n = (if n = 0 then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) ^ n = (if n = 0 then 1::'a else (0::'a))
[PROOF STEP]
by (induct n) simp_all


[STATEMENT]
lemma iadd_Suc: "((m::eint) + 1) + n = (m + n) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m + 1 + n = m + n + 1
[PROOF STEP]
by (metis ab_semigroup_add_class.add_ac(1) add.assoc add.commute)


[STATEMENT]
lemma word_pow_0: "(2::'a::len word) ^ LENGTH('a) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ LENGTH('a) = 0
[PROOF STEP]
by (fact word_exp_length_eq_0)