[STATEMENT]
lemma renaming_preserves_literal_order :
  assumes "literal_ordering L1 L2"
  shows "literal_ordering (rename_literal A L1) (rename_literal A L2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. literal_ordering (rename_literal A L1) (rename_literal A L2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. literal_ordering (rename_literal A L1) (rename_literal A L2)
[PROOF STEP]
obtain A1 where at1: "L1 = (Pos A1) \<or> L1 = (Neg A1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A1. L1 = Pos A1 \<or> L1 = Neg A1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Literal.exhaust [of L1 ]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x1. L1 = Pos x1 \<Longrightarrow> ?P; \<And>x2. L1 = Neg x2 \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<And>A1. L1 = Pos A1 \<or> L1 = Neg A1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
L1 = Pos A1 \<or> L1 = Neg A1

goal (1 subgoal):
 1. literal_ordering (rename_literal A L1) (rename_literal A L2)
[PROOF STEP]
obtain A2 where at2: "L2 = (Pos A2) \<or> L2 = (Neg A2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A2. L2 = Pos A2 \<or> L2 = Neg A2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Literal.exhaust [of L2 ]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x1. L2 = Pos x1 \<Longrightarrow> ?P; \<And>x2. L2 = Neg x2 \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<And>A2. L2 = Pos A2 \<or> L2 = Neg A2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
L2 = Pos A2 \<or> L2 = Neg A2

goal (1 subgoal):
 1. literal_ordering (rename_literal A L1) (rename_literal A L2)
[PROOF STEP]
from assms and at1 and at2
[PROOF STATE]
proof (chain)
picking this:
literal_ordering L1 L2
L1 = Pos A1 \<or> L1 = Neg A1
L2 = Pos A2 \<or> L2 = Neg A2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
literal_ordering L1 L2
L1 = Pos A1 \<or> L1 = Neg A1
L2 = Pos A2 \<or> L2 = Neg A2

goal (1 subgoal):
 1. literal_ordering (rename_literal A L1) (rename_literal A L2)
[PROOF STEP]
unfolding rename_literal_def
[PROOF STATE]
proof (prove)
using this:
literal_ordering L1 L2
L1 = Pos A1 \<or> L1 = Neg A1
L2 = Pos A2 \<or> L2 = Neg A2

goal (1 subgoal):
 1. literal_ordering (if atom L1 \<in> A then complement L1 else L1) (if atom L2 \<in> A then complement L2 else L2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
literal_ordering (rename_literal A L1) (rename_literal A L2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_count_vec:
  assumes "finite (set\<^sub>v v)"
  shows "(\<Sum> i \<in> set\<^sub>v v. count_vec v i) = dim_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (count_vec v) (set\<^sub>v v) = dim_vec v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (set\<^sub>v v)

goal (1 subgoal):
 1. sum (count_vec v) (set\<^sub>v v) = dim_vec v
[PROOF STEP]
proof (induct "v")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (set\<^sub>v vNil) \<Longrightarrow> sum (count_vec vNil) (set\<^sub>v vNil) = dim_vec vNil
 2. \<And>a v. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v))\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
case vNil
[PROOF STATE]
proof (state)
this:
finite (set\<^sub>v vNil)

goal (2 subgoals):
 1. finite (set\<^sub>v vNil) \<Longrightarrow> sum (count_vec vNil) (set\<^sub>v vNil) = dim_vec vNil
 2. \<And>a v. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v))\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (set\<^sub>v vNil)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite (set\<^sub>v vNil)

goal (1 subgoal):
 1. sum (count_vec vNil) (set\<^sub>v vNil) = dim_vec vNil
[PROOF STEP]
by (simp add: count_vec_empty)
[PROOF STATE]
proof (state)
this:
sum (count_vec vNil) (set\<^sub>v vNil) = dim_vec vNil

goal (1 subgoal):
 1. \<And>a v. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v))\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a v. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v))\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
case (vCons a v)
[PROOF STATE]
proof (state)
this:
finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v
finite (set\<^sub>v (vCons a v))

goal (1 subgoal):
 1. \<And>a v. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v))\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v
finite (set\<^sub>v (vCons a v))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v
finite (set\<^sub>v (vCons a v))

goal (1 subgoal):
 1. sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
proof (cases "a \<in> set\<^sub>v v")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a \<in> set\<^sub>v v

goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
have cv: "\<And> x. x \<in>(set\<^sub>v v) - {a} \<Longrightarrow> count_vec (vCons a v) x = count_vec v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set\<^sub>v v - {a} \<Longrightarrow> count_vec (vCons a v) x = count_vec v x
[PROOF STEP]
using count_vec_vCons
[PROOF STATE]
proof (prove)
using this:
count_vec (vCons ?aa ?v) ?a = (if ?aa = ?a then count_vec ?v ?a + 1 else count_vec ?v ?a)

goal (1 subgoal):
 1. \<And>x. x \<in> set\<^sub>v v - {a} \<Longrightarrow> count_vec (vCons a v) x = count_vec v x
[PROOF STEP]
by (metis DiffD2 singletonI)
[PROOF STATE]
proof (state)
this:
?x \<in> set\<^sub>v v - {a} \<Longrightarrow> count_vec (vCons a v) ?x = count_vec v ?x

goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> set\<^sub>v v - {a} \<Longrightarrow> count_vec (vCons a v) ?x = count_vec v ?x
[PROOF STEP]
have "sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) =  sum (count_vec (vCons a v)) (set\<^sub>v v)"
[PROOF STATE]
proof (prove)
using this:
?x \<in> set\<^sub>v v - {a} \<Longrightarrow> count_vec (vCons a v) ?x = count_vec v ?x

goal (1 subgoal):
 1. sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = sum (count_vec (vCons a v)) (set\<^sub>v v)
[PROOF STEP]
using vCons_set_contains_in True
[PROOF STATE]
proof (prove)
using this:
?x \<in> set\<^sub>v v - {a} \<Longrightarrow> count_vec (vCons a v) ?x = count_vec v ?x
?a \<in> set\<^sub>v ?v \<Longrightarrow> set\<^sub>v (vCons ?a ?v) = set\<^sub>v ?v
a \<in> set\<^sub>v v

goal (1 subgoal):
 1. sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = sum (count_vec (vCons a v)) (set\<^sub>v v)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = sum (count_vec (vCons a v)) (set\<^sub>v v)

goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = sum (count_vec (vCons a v)) (set\<^sub>v v)

goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
have "... = count_vec (vCons a v) a + sum (count_vec (vCons a v)) ((set\<^sub>v v) - {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (count_vec (vCons a v)) (set\<^sub>v v) = count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v - {a})
[PROOF STEP]
using sum.remove True vCons.prems(1)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> sum ?g ?A = ?g ?x + sum ?g (?A - {?x})
a \<in> set\<^sub>v v
finite (set\<^sub>v (vCons a v))

goal (1 subgoal):
 1. sum (count_vec (vCons a v)) (set\<^sub>v v) = count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v - {a})
[PROOF STEP]
by (metis vCons_set_contains_in)
[PROOF STATE]
proof (state)
this:
sum (count_vec (vCons a v)) (set\<^sub>v v) = count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v - {a})

goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (count_vec (vCons a v)) (set\<^sub>v v) = count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v - {a})

goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
have "... = count_vec v a + 1 + sum (count_vec v) ((set\<^sub>v v) - {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v - {a}) = count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v - {a})
[PROOF STEP]
using cv count_vec_vCons
[PROOF STATE]
proof (prove)
using this:
?x \<in> set\<^sub>v v - {a} \<Longrightarrow> count_vec (vCons a v) ?x = count_vec v ?x
count_vec (vCons ?aa ?v) ?a = (if ?aa = ?a then count_vec ?v ?a + 1 else count_vec ?v ?a)

goal (1 subgoal):
 1. count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v - {a}) = count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v - {a})
[PROOF STEP]
by (metis sum.cong)
[PROOF STATE]
proof (state)
this:
count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v - {a}) = count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v - {a})

goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v - {a}) = count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v - {a})

goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
have "... = 1 + sum (count_vec v) ((set\<^sub>v v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v - {a}) = 1 + sum (count_vec v) (set\<^sub>v v)
[PROOF STEP]
using sum.remove add.commute vCons.prems vCons_set_contains_in True
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> sum ?g ?A = ?g ?x + sum ?g (?A - {?x})
?a + ?b = ?b + ?a
finite (set\<^sub>v (vCons a v))
?a \<in> set\<^sub>v ?v \<Longrightarrow> set\<^sub>v (vCons ?a ?v) = set\<^sub>v ?v
a \<in> set\<^sub>v v

goal (1 subgoal):
 1. count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v - {a}) = 1 + sum (count_vec v) (set\<^sub>v v)
[PROOF STEP]
by (metis (no_types, opaque_lifting) ab_semigroup_add_class.add_ac(1))
[PROOF STATE]
proof (state)
this:
count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v - {a}) = 1 + sum (count_vec v) (set\<^sub>v v)

goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v - {a}) = 1 + sum (count_vec v) (set\<^sub>v v)

goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
have "... = 1 + dim_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + sum (count_vec v) (set\<^sub>v v) = 1 + dim_vec v
[PROOF STEP]
using vCons.hyps
[PROOF STATE]
proof (prove)
using this:
finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v

goal (1 subgoal):
 1. 1 + sum (count_vec v) (set\<^sub>v v) = 1 + dim_vec v
[PROOF STEP]
by (metis True vCons.prems vCons_set_contains_in)
[PROOF STATE]
proof (state)
this:
1 + sum (count_vec v) (set\<^sub>v v) = 1 + dim_vec v

goal (2 subgoals):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<in> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
 2. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = 1 + dim_vec v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = 1 + dim_vec v

goal (1 subgoal):
 1. sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)

goal (1 subgoal):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<notin> set\<^sub>v v

goal (1 subgoal):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<notin> set\<^sub>v v
[PROOF STEP]
have cv: "\<And> x. x \<in>(set\<^sub>v v) \<Longrightarrow> count_vec (vCons a v) x = count_vec v x"
[PROOF STATE]
proof (prove)
using this:
a \<notin> set\<^sub>v v

goal (1 subgoal):
 1. \<And>x. x \<in> set\<^sub>v v \<Longrightarrow> count_vec (vCons a v) x = count_vec v x
[PROOF STEP]
using count_vec_vCons
[PROOF STATE]
proof (prove)
using this:
a \<notin> set\<^sub>v v
count_vec (vCons ?aa ?v) ?a = (if ?aa = ?a then count_vec ?v ?a + 1 else count_vec ?v ?a)

goal (1 subgoal):
 1. \<And>x. x \<in> set\<^sub>v v \<Longrightarrow> count_vec (vCons a v) x = count_vec v x
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
?x \<in> set\<^sub>v v \<Longrightarrow> count_vec (vCons a v) ?x = count_vec v ?x

goal (1 subgoal):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
have f: "finite (set\<^sub>v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set\<^sub>v v)
[PROOF STEP]
using vCons.prems False vCons_set_contains_add
[PROOF STATE]
proof (prove)
using this:
finite (set\<^sub>v (vCons a v))
a \<notin> set\<^sub>v v
?a \<notin> set\<^sub>v ?v \<Longrightarrow> set\<^sub>v (vCons ?a ?v) = set\<^sub>v ?v \<union> {?a}

goal (1 subgoal):
 1. finite (set\<^sub>v v)
[PROOF STEP]
by (metis Un_infinite)
[PROOF STATE]
proof (state)
this:
finite (set\<^sub>v v)

goal (1 subgoal):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
have "sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) =
        count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v)
[PROOF STEP]
using False vCons_set_contains_add
[PROOF STATE]
proof (prove)
using this:
a \<notin> set\<^sub>v v
?a \<notin> set\<^sub>v ?v \<Longrightarrow> set\<^sub>v (vCons ?a ?v) = set\<^sub>v ?v \<union> {?a}

goal (1 subgoal):
 1. sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v)
[PROOF STEP]
by (metis Un_insert_right finite_Un sum.insert sup_bot_right vCons.prems )
[PROOF STATE]
proof (state)
this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v)

goal (1 subgoal):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v)

goal (1 subgoal):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
have "... = count_vec v a + 1 + sum (count_vec v) ((set\<^sub>v v) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v) = count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v)
[PROOF STEP]
using cv count_vec_vCons
[PROOF STATE]
proof (prove)
using this:
?x \<in> set\<^sub>v v \<Longrightarrow> count_vec (vCons a v) ?x = count_vec v ?x
count_vec (vCons ?aa ?v) ?a = (if ?aa = ?a then count_vec ?v ?a + 1 else count_vec ?v ?a)

goal (1 subgoal):
 1. count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v) = count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v)
[PROOF STEP]
by (metis sum.cong)
[PROOF STATE]
proof (state)
this:
count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v) = count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v)

goal (1 subgoal):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count_vec (vCons a v) a + sum (count_vec (vCons a v)) (set\<^sub>v v) = count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v)

goal (1 subgoal):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
have "... = 1 + sum (count_vec v) ((set\<^sub>v v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v) = 1 + sum (count_vec v) (set\<^sub>v v)
[PROOF STEP]
using False setv_not_in_count0_iff
[PROOF STATE]
proof (prove)
using this:
a \<notin> set\<^sub>v v
(?a \<notin> set\<^sub>v ?v) = (count_vec ?v ?a = 0)

goal (1 subgoal):
 1. count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v) = 1 + sum (count_vec v) (set\<^sub>v v)
[PROOF STEP]
by (metis add_0)
[PROOF STATE]
proof (state)
this:
count_vec v a + 1 + sum (count_vec v) (set\<^sub>v v) = 1 + sum (count_vec v) (set\<^sub>v v)

goal (1 subgoal):
 1. \<lbrakk>finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v; finite (set\<^sub>v (vCons a v)); a \<notin> set\<^sub>v v\<rbrakk> \<Longrightarrow> sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = 1 + sum (count_vec v) (set\<^sub>v v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = 1 + sum (count_vec v) (set\<^sub>v v)

goal (1 subgoal):
 1. sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
using vCons.hyps f
[PROOF STATE]
proof (prove)
using this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = 1 + sum (count_vec v) (set\<^sub>v v)
finite (set\<^sub>v v) \<Longrightarrow> sum (count_vec v) (set\<^sub>v v) = dim_vec v
finite (set\<^sub>v v)

goal (1 subgoal):
 1. sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum (count_vec (vCons a v)) (set\<^sub>v (vCons a v)) = dim_vec (vCons a v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma param_uncurry[param]: "(uncurry,uncurry) \<in> (A\<rightarrow>B\<rightarrow>C) \<rightarrow> A\<times>\<^sub>rB\<rightarrow>C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (uncurry, uncurry) \<in> (A \<rightarrow> B \<rightarrow> C) \<rightarrow> A \<times>\<^sub>r B \<rightarrow> C
[PROOF STEP]
unfolding uncurry_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case_prod, case_prod) \<in> (A \<rightarrow> B \<rightarrow> C) \<rightarrow> A \<times>\<^sub>r B \<rightarrow> C
[PROOF STEP]
by parametricity


[STATEMENT]
lemma encode2_alter:
  assumes "avars \<subseteq> A"
  shows "encode2 i = digit_decode dims2 (nths (digit_encode dims i) (A-vars))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. encode2 i = digit_decode dims2 (nths (digit_encode dims i) (A - vars))
[PROOF STEP]
using length_digit_encode[of dims i] nths_minus_eq[of "digit_encode dims i" A] assms
[PROOF STATE]
proof (prove)
using this:
length (digit_encode dims i) = length dims
{0..<length (digit_encode dims i)} \<subseteq> A \<Longrightarrow> nths (digit_encode dims i) (- ?B) = nths (digit_encode dims i) (A - ?B)
avars \<subseteq> A

goal (1 subgoal):
 1. encode2 i = digit_decode dims2 (nths (digit_encode dims i) (A - vars))
[PROOF STEP]
unfolding encode2_def
[PROOF STATE]
proof (prove)
using this:
length (digit_encode dims i) = length dims
{0..<length (digit_encode dims i)} \<subseteq> A \<Longrightarrow> nths (digit_encode dims i) (- ?B) = nths (digit_encode dims i) (A - ?B)
avars \<subseteq> A

goal (1 subgoal):
 1. digit_decode dims2 (nths (digit_encode dims i) (- vars)) = digit_decode dims2 (nths (digit_encode dims i) (A - vars))
[PROOF STEP]
by (subgoal_tac "nths (digit_encode dims i) (- vars) = nths (digit_encode dims i) (A - vars)", auto)


[STATEMENT]
lemma prime_dvd_mersenneD':
  fixes p q :: nat
  assumes "prime p" "p \<noteq> 2" "prime q" "q dvd (2 ^ p - 1)"
  shows "\<exists>k>0. q = 1 + 2 * k * p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k>0. q = 1 + 2 * k * p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k>0. q = 1 + 2 * k * p
[PROOF STEP]
have "q \<noteq> 0" "q \<noteq> 1" "q \<noteq> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<noteq> 0 &&& q \<noteq> 1 &&& q \<noteq> 2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p
p \<noteq> 2
prime q
q dvd 2 ^ p - 1

goal (1 subgoal):
 1. q \<noteq> 0 &&& q \<noteq> 1 &&& q \<noteq> 2
[PROOF STEP]
by (auto intro!: Nat.gr0I)
[PROOF STATE]
proof (state)
this:
q \<noteq> 0
q \<noteq> 1
q \<noteq> 2

goal (1 subgoal):
 1. \<exists>k>0. q = 1 + 2 * k * p
[PROOF STEP]
hence "q > 2"
[PROOF STATE]
proof (prove)
using this:
q \<noteq> 0
q \<noteq> 1
q \<noteq> 2

goal (1 subgoal):
 1. 2 < q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 < q

goal (1 subgoal):
 1. \<exists>k>0. q = 1 + 2 * k * p
[PROOF STEP]
have "[q = 1] (mod (2 * p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [q = 1] (mod 2 * p)
[PROOF STEP]
by (rule prime_dvd_mersenneD) fact+
[PROOF STATE]
proof (state)
this:
[q = 1] (mod 2 * p)

goal (1 subgoal):
 1. \<exists>k>0. q = 1 + 2 * k * p
[PROOF STEP]
hence "(2 * p) dvd (q - 1)"
[PROOF STATE]
proof (prove)
using this:
[q = 1] (mod 2 * p)

goal (1 subgoal):
 1. 2 * p dvd q - 1
[PROOF STEP]
using \<open>q > 2\<close>
[PROOF STATE]
proof (prove)
using this:
[q = 1] (mod 2 * p)
2 < q

goal (1 subgoal):
 1. 2 * p dvd q - 1
[PROOF STEP]
by (auto simp: cong_altdef_nat)
[PROOF STATE]
proof (state)
this:
2 * p dvd q - 1

goal (1 subgoal):
 1. \<exists>k>0. q = 1 + 2 * k * p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * p dvd q - 1
[PROOF STEP]
obtain k where k: "q - 1 = (2 * p) * k"
[PROOF STATE]
proof (prove)
using this:
2 * p dvd q - 1

goal (1 subgoal):
 1. (\<And>k. q - 1 = 2 * p * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
q - 1 = 2 * p * k

goal (1 subgoal):
 1. \<exists>k>0. q = 1 + 2 * k * p
[PROOF STEP]
hence "q = 1 + 2 * k * p"
[PROOF STATE]
proof (prove)
using this:
q - 1 = 2 * p * k

goal (1 subgoal):
 1. q = 1 + 2 * k * p
[PROOF STEP]
using \<open>q > 2\<close>
[PROOF STATE]
proof (prove)
using this:
q - 1 = 2 * p * k
2 < q

goal (1 subgoal):
 1. q = 1 + 2 * k * p
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
q = 1 + 2 * k * p

goal (1 subgoal):
 1. \<exists>k>0. q = 1 + 2 * k * p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
q = 1 + 2 * k * p

goal (1 subgoal):
 1. \<exists>k>0. q = 1 + 2 * k * p
[PROOF STEP]
have "k > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k
[PROOF STEP]
using \<open>q > 2\<close> and k
[PROOF STATE]
proof (prove)
using this:
2 < q
q - 1 = 2 * p * k

goal (1 subgoal):
 1. 0 < k
[PROOF STEP]
by (intro Nat.gr0I) auto
[PROOF STATE]
proof (state)
this:
0 < k

goal (1 subgoal):
 1. \<exists>k>0. q = 1 + 2 * k * p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
q = 1 + 2 * k * p
0 < k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
q = 1 + 2 * k * p
0 < k

goal (1 subgoal):
 1. \<exists>k>0. q = 1 + 2 * k * p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k>0. q = 1 + 2 * k * p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lattice_singletonI:
     "[|lattice L; !!s. s \<in> X ==> {s} \<in> L|] ==> X \<in> L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lattice L; \<And>s. s \<in> X \<Longrightarrow> {s} \<in> L\<rbrakk> \<Longrightarrow> X \<in> L
[PROOF STEP]
apply (cut_tac UN_singleton [of X])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lattice L; \<And>s. s \<in> X \<Longrightarrow> {s} \<in> L; (\<Union>x\<in>X. {x}) = X\<rbrakk> \<Longrightarrow> X \<in> L
[PROOF STEP]
apply (erule subst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lattice L; \<And>s. s \<in> X \<Longrightarrow> {s} \<in> L\<rbrakk> \<Longrightarrow> (\<Union>x\<in>X. {x}) \<in> L
[PROOF STEP]
apply (simp only: UN_in_lattice)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Bloch_lemma_0:
  assumes holf: "f holomorphic_on cball 0 r" and "0 < r"
      and [simp]: "f 0 = 0"
      and le: "\<And>z. norm z < r \<Longrightarrow> norm(deriv f z) \<le> 2 * norm(deriv f 0)"
    shows "ball 0 ((3 - 2 * sqrt 2) * r * norm(deriv f 0)) \<subseteq> f ` ball 0 r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
have "sqrt 2 < 3/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt 2 < 3 / 2
[PROOF STEP]
by (rule real_less_lsqrt) (auto simp: power2_eq_square)
[PROOF STATE]
proof (state)
this:
sqrt 2 < 3 / 2

goal (1 subgoal):
 1. ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sqrt 2 < 3 / 2
[PROOF STEP]
have sq3: "0 < 3 - 2 * sqrt 2"
[PROOF STATE]
proof (prove)
using this:
sqrt 2 < 3 / 2

goal (1 subgoal):
 1. 0 < 3 - 2 * sqrt 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 3 - 2 * sqrt 2

goal (1 subgoal):
 1. ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
proof (cases "deriv f 0 = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. deriv f 0 = 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
 2. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
deriv f 0 = 0

goal (2 subgoals):
 1. deriv f 0 = 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
 2. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv f 0 = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deriv f 0 = 0

goal (1 subgoal):
 1. ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
deriv f 0 \<noteq> 0

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
define C where "C = 2 * norm(deriv f 0)"
[PROOF STATE]
proof (state)
this:
C = 2 * cmod (deriv f 0)

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
have "0 < C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < C
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
deriv f 0 \<noteq> 0

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

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
have holf': "f holomorphic_on ball 0 r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f holomorphic_on ball 0 r
[PROOF STEP]
using holf
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on cball 0 r

goal (1 subgoal):
 1. f holomorphic_on ball 0 r
[PROOF STEP]
using ball_subset_cball holomorphic_on_subset
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on cball 0 r
ball ?x ?e \<subseteq> cball ?x ?e
\<lbrakk>?f holomorphic_on ?s; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> ?f holomorphic_on ?t

goal (1 subgoal):
 1. f holomorphic_on ball 0 r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f holomorphic_on ball 0 r

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f holomorphic_on ball 0 r
[PROOF STEP]
have holdf': "deriv f holomorphic_on ball 0 r"
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on ball 0 r

goal (1 subgoal):
 1. deriv f holomorphic_on ball 0 r
[PROOF STEP]
by (rule holomorphic_deriv [OF _ open_ball])
[PROOF STATE]
proof (state)
this:
deriv f holomorphic_on ball 0 r

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
have "Le1": "norm(deriv f z - deriv f 0) \<le> norm z / (r - norm z) * C"
                if "norm z < r" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (r - cmod z) * C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (r - cmod z) * C
[PROOF STEP]
have T1: "norm(deriv f z - deriv f 0) \<le> norm z / (R - norm z) * C"
              if R: "norm z < R" "R < r" for R
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C
[PROOF STEP]
have "0 < R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < R
[PROOF STEP]
using R
[PROOF STATE]
proof (prove)
using this:
cmod z < R
R < r

goal (1 subgoal):
 1. 0 < R
[PROOF STEP]
by (metis less_trans norm_zero zero_less_norm_iff)
[PROOF STATE]
proof (state)
this:
0 < R

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C
[PROOF STEP]
have df_le: "\<And>x. norm x < r \<Longrightarrow> norm (deriv f x) \<le> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. cmod x < r \<Longrightarrow> cmod (deriv f x) \<le> C
[PROOF STEP]
using le
[PROOF STATE]
proof (prove)
using this:
cmod ?z < r \<Longrightarrow> cmod (deriv f ?z) \<le> 2 * cmod (deriv f 0)

goal (1 subgoal):
 1. \<And>x. cmod x < r \<Longrightarrow> cmod (deriv f x) \<le> C
[PROOF STEP]
by (simp add: C_def)
[PROOF STATE]
proof (state)
this:
cmod ?x < r \<Longrightarrow> cmod (deriv f ?x) \<le> C

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C
[PROOF STEP]
have hol_df: "deriv f holomorphic_on cball 0 R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv f holomorphic_on cball 0 R
[PROOF STEP]
using R holdf' holomorphic_on_subset
[PROOF STATE]
proof (prove)
using this:
cmod z < R
R < r
deriv f holomorphic_on ball 0 r
\<lbrakk>?f holomorphic_on ?s; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> ?f holomorphic_on ?t

goal (1 subgoal):
 1. deriv f holomorphic_on cball 0 R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
deriv f holomorphic_on cball 0 R

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C
[PROOF STEP]
have *: "((\<lambda>w. deriv f w / (w - z)) has_contour_integral 2 * pi * \<i> * deriv f z) (circlepath 0 R)"
                 if "norm z < R" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>w. deriv f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * deriv f z) (circlepath 0 R)
[PROOF STEP]
using \<open>0 < R\<close> that Cauchy_integral_formula_convex_simple [OF convex_cball hol_df, of _ "circlepath 0 R"]
[PROOF STATE]
proof (prove)
using this:
0 < R
cmod z < R
\<lbrakk>?z \<in> interior (cball 0 R); valid_path (circlepath 0 R); path_image (circlepath 0 R) \<subseteq> cball 0 R - {?z}; pathfinish (circlepath 0 R) = pathstart (circlepath 0 R)\<rbrakk> \<Longrightarrow> ((\<lambda>w. deriv f w / (w - ?z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number (circlepath 0 R) ?z * deriv f ?z) (circlepath 0 R)

goal (1 subgoal):
 1. ((\<lambda>w. deriv f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * deriv f z) (circlepath 0 R)
[PROOF STEP]
by (force simp: winding_number_circlepath)
[PROOF STATE]
proof (state)
this:
cmod ?z < R \<Longrightarrow> ((\<lambda>w. deriv f w / (w - ?z)) has_contour_integral complex_of_real (2 * pi) * \<i> * deriv f ?z) (circlepath 0 R)

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C
[PROOF STEP]
have **: "((\<lambda>x. deriv f x / (x - z) - deriv f x / x) has_contour_integral
                   of_real (2 * pi) * \<i> * (deriv f z - deriv f 0))
                  (circlepath 0 R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. deriv f x / (x - z) - deriv f x / x) has_contour_integral complex_of_real (2 * pi) * \<i> * (deriv f z - deriv f 0)) (circlepath 0 R)
[PROOF STEP]
using has_contour_integral_diff [OF * [of z] * [of 0]] \<open>0 < R\<close> that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>cmod z < R; cmod 0 < R\<rbrakk> \<Longrightarrow> ((\<lambda>x. deriv f x / (x - z) - deriv f x / (x - 0)) has_contour_integral complex_of_real (2 * pi) * \<i> * deriv f z - complex_of_real (2 * pi) * \<i> * deriv f 0) (circlepath 0 R)
0 < R
cmod z < R
R < r

goal (1 subgoal):
 1. ((\<lambda>x. deriv f x / (x - z) - deriv f x / x) has_contour_integral complex_of_real (2 * pi) * \<i> * (deriv f z - deriv f 0)) (circlepath 0 R)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. deriv f x / (x - z) - deriv f x / x) has_contour_integral complex_of_real (2 * pi) * \<i> * (deriv f z - deriv f 0)) (circlepath 0 R)

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C
[PROOF STEP]
have [simp]: "\<And>x. norm x = R \<Longrightarrow> x \<noteq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. cmod x = R \<Longrightarrow> x \<noteq> z
[PROOF STEP]
using that(1)
[PROOF STATE]
proof (prove)
using this:
cmod z < R

goal (1 subgoal):
 1. \<And>x. cmod x = R \<Longrightarrow> x \<noteq> z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cmod ?x = R \<Longrightarrow> ?x \<noteq> z

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C
[PROOF STEP]
have "norm (deriv f x / (x - z) - deriv f x / x)
                     \<le> C * norm z / (R * (R - norm z))"
                  if "norm x = R" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (deriv f x / (x - z) - deriv f x / x) \<le> C * cmod z / (R * (R - cmod z))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (deriv f x / (x - z) - deriv f x / x) \<le> C * cmod z / (R * (R - cmod z))
[PROOF STEP]
have [simp]: "norm (deriv f x * x - deriv f x * (x - z)) =
                        norm (deriv f x) * norm z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (deriv f x * x - deriv f x * (x - z)) = cmod (deriv f x) * cmod z
[PROOF STEP]
by (simp add: norm_mult right_diff_distrib')
[PROOF STATE]
proof (state)
this:
cmod (deriv f x * x - deriv f x * (x - z)) = cmod (deriv f x) * cmod z

goal (1 subgoal):
 1. cmod (deriv f x / (x - z) - deriv f x / x) \<le> C * cmod z / (R * (R - cmod z))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (deriv f x / (x - z) - deriv f x / x) \<le> C * cmod z / (R * (R - cmod z))
[PROOF STEP]
using \<open>0 < R\<close> \<open>0 < C\<close> R that
[PROOF STATE]
proof (prove)
using this:
0 < R
0 < C
cmod z < R
R < r
cmod x = R

goal (1 subgoal):
 1. cmod (deriv f x / (x - z) - deriv f x / x) \<le> C * cmod z / (R * (R - cmod z))
[PROOF STEP]
by (auto simp add: norm_mult norm_divide divide_simps df_le mult_mono norm_triangle_ineq2)
[PROOF STATE]
proof (state)
this:
cmod (deriv f x / (x - z) - deriv f x / x) \<le> C * cmod z / (R * (R - cmod z))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cmod ?x = R \<Longrightarrow> cmod (deriv f ?x / (?x - z) - deriv f ?x / ?x) \<le> C * cmod z / (R * (R - cmod z))

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod ?x = R \<Longrightarrow> cmod (deriv f ?x / (?x - z) - deriv f ?x / ?x) \<le> C * cmod z / (R * (R - cmod z))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod ?x = R \<Longrightarrow> cmod (deriv f ?x / (?x - z) - deriv f ?x / ?x) \<le> C * cmod z / (R * (R - cmod z))

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C
[PROOF STEP]
using has_contour_integral_bound_circlepath
                  [OF **, of "C * norm z/(R*(R - norm z))"]
                \<open>0 < R\<close> \<open>0 < C\<close> R
[PROOF STATE]
proof (prove)
using this:
cmod ?x = R \<Longrightarrow> cmod (deriv f ?x / (?x - z) - deriv f ?x / ?x) \<le> C * cmod z / (R * (R - cmod z))
\<lbrakk>0 \<le> C * cmod z / (R * (R - cmod z)); 0 < R; \<And>x. cmod (x - 0) = R \<Longrightarrow> cmod (deriv f x / (x - z) - deriv f x / x) \<le> C * cmod z / (R * (R - cmod z))\<rbrakk> \<Longrightarrow> cmod (complex_of_real (2 * pi) * \<i> * (deriv f z - deriv f 0)) \<le> C * cmod z / (R * (R - cmod z)) * (2 * pi * R)
0 < R
0 < C
cmod z < R
R < r

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C
[PROOF STEP]
apply (simp add: norm_mult norm_divide)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. cmod x = R \<Longrightarrow> cmod (deriv f x / (x - z) - deriv f x / x) \<le> C * cmod z / (R * (R - cmod z)); 2 * pi * cmod (deriv f z - deriv f 0) \<le> C * (cmod z * (2 * pi)) / (R - cmod z); 0 < R; 0 < C; cmod z < R; R < r\<rbrakk> \<Longrightarrow> cmod (deriv f z - deriv f 0) \<le> cmod z * C / (R - cmod z)
[PROOF STEP]
apply (simp add: divide_simps mult.commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cmod (deriv f z - deriv f 0) \<le> cmod z / (R - cmod z) * C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>cmod z < ?R; ?R < r\<rbrakk> \<Longrightarrow> cmod (deriv f z - deriv f 0) \<le> cmod z / (?R - cmod z) * C

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (r - cmod z) * C
[PROOF STEP]
obtain r' where r': "norm z < r'" "r' < r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r'. \<lbrakk>cmod z < r'; r' < r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Rats_dense_in_real [of "norm z" r] \<open>norm z < r\<close>
[PROOF STATE]
proof (prove)
using this:
cmod z < r \<Longrightarrow> \<exists>ra\<in>\<rat>. cmod z < ra \<and> ra < r
cmod z < r

goal (1 subgoal):
 1. (\<And>r'. \<lbrakk>cmod z < r'; r' < r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cmod z < r'
r' < r

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (r - cmod z) * C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod z < r'
r' < r
[PROOF STEP]
have [simp]: "closure {r'<..<r} = {r'..r}"
[PROOF STATE]
proof (prove)
using this:
cmod z < r'
r' < r

goal (1 subgoal):
 1. closure {r'<..<r} = {r'..r}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
closure {r'<..<r} = {r'..r}

goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (r - cmod z) * C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (deriv f z - deriv f 0) \<le> cmod z / (r - cmod z) * C
[PROOF STEP]
apply (rule continuous_ge_on_closure
                 [where f = "\<lambda>r. norm z / (r - norm z) * C" and s = "{r'<..<r}",
                  OF _ _ T1])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. continuous_on (closure {r'<..<r}) (\<lambda>r. cmod z / (r - cmod z) * C)
 2. r \<in> closure {r'<..<r}
 3. \<And>x. x \<in> {r'<..<r} \<Longrightarrow> cmod z < x
 4. \<And>x. x \<in> {r'<..<r} \<Longrightarrow> x < r
[PROOF STEP]
using that r'
[PROOF STATE]
proof (prove)
using this:
cmod z < r
cmod z < r'
r' < r

goal (4 subgoals):
 1. continuous_on (closure {r'<..<r}) (\<lambda>r. cmod z / (r - cmod z) * C)
 2. r \<in> closure {r'<..<r}
 3. \<And>x. x \<in> {r'<..<r} \<Longrightarrow> cmod z < x
 4. \<And>x. x \<in> {r'<..<r} \<Longrightarrow> x < r
[PROOF STEP]
by (auto simp: not_le intro!: continuous_intros)
[PROOF STATE]
proof (state)
this:
cmod (deriv f z - deriv f 0) \<le> cmod z / (r - cmod z) * C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cmod ?z < r \<Longrightarrow> cmod (deriv f ?z - deriv f 0) \<le> cmod ?z / (r - cmod ?z) * C

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
have "*": "(norm z - norm z^2/(r - norm z)) * norm(deriv f 0) \<le> norm(f z)"
              if r: "norm z < r" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
have 1: "\<And>x. x \<in> ball 0 r \<Longrightarrow>
              ((\<lambda>z. f z - deriv f 0 * z) has_field_derivative deriv f x - deriv f 0)
               (at x within ball 0 r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> ball 0 r \<Longrightarrow> ((\<lambda>z. f z - deriv f 0 * z) has_field_derivative deriv f x - deriv f 0) (at x within ball 0 r)
[PROOF STEP]
by (rule derivative_eq_intros holomorphic_derivI holf' | simp)+
[PROOF STATE]
proof (state)
this:
?x \<in> ball 0 r \<Longrightarrow> ((\<lambda>z. f z - deriv f 0 * z) has_field_derivative deriv f ?x - deriv f 0) (at ?x within ball 0 r)

goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
have 2: "closed_segment 0 z \<subseteq> ball 0 r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment 0 z \<subseteq> ball 0 r
[PROOF STEP]
by (metis \<open>0 < r\<close> convex_ball convex_contains_segment dist_self mem_ball mem_ball_0 that)
[PROOF STATE]
proof (state)
this:
closed_segment 0 z \<subseteq> ball 0 r

goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
have 4: "norm (deriv f (x *\<^sub>R z) - deriv f 0) * norm z \<le> norm z * norm z * x * C / (r - norm z)"
              if x: "0 \<le> x" "x \<le> 1" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod z * cmod z * x * C / (r - cmod z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod z * cmod z * x * C / (r - cmod z)
[PROOF STEP]
have [simp]: "x * norm z < r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * cmod z < r
[PROOF STEP]
using r x
[PROOF STATE]
proof (prove)
using this:
cmod z < r
0 \<le> x
x \<le> 1

goal (1 subgoal):
 1. x * cmod z < r
[PROOF STEP]
by (meson le_less_trans mult_le_cancel_right2 norm_not_less_zero)
[PROOF STATE]
proof (state)
this:
x * cmod z < r

goal (1 subgoal):
 1. cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod z * cmod z * x * C / (r - cmod z)
[PROOF STEP]
have "norm (deriv f (x *\<^sub>R z) - deriv f 0) \<le> norm (x *\<^sub>R z) / (r - norm (x *\<^sub>R z)) * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (deriv f (x *\<^sub>R z) - deriv f 0) \<le> cmod (x *\<^sub>R z) / (r - cmod (x *\<^sub>R z)) * C
[PROOF STEP]
apply (rule Le1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (x *\<^sub>R z) < r
[PROOF STEP]
using r x \<open>0 < r\<close>
[PROOF STATE]
proof (prove)
using this:
cmod z < r
0 \<le> x
x \<le> 1
0 < r

goal (1 subgoal):
 1. cmod (x *\<^sub>R z) < r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (deriv f (x *\<^sub>R z) - deriv f 0) \<le> cmod (x *\<^sub>R z) / (r - cmod (x *\<^sub>R z)) * C

goal (1 subgoal):
 1. cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod z * cmod z * x * C / (r - cmod z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (deriv f (x *\<^sub>R z) - deriv f 0) \<le> cmod (x *\<^sub>R z) / (r - cmod (x *\<^sub>R z)) * C

goal (1 subgoal):
 1. cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod z * cmod z * x * C / (r - cmod z)
[PROOF STEP]
have "... \<le> norm (x *\<^sub>R z) / (r - norm z) * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (x *\<^sub>R z) / (r - cmod (x *\<^sub>R z)) * C \<le> cmod (x *\<^sub>R z) / (r - cmod z) * C
[PROOF STEP]
using r x \<open>0 < r\<close>
[PROOF STATE]
proof (prove)
using this:
cmod z < r
0 \<le> x
x \<le> 1
0 < r

goal (1 subgoal):
 1. cmod (x *\<^sub>R z) / (r - cmod (x *\<^sub>R z)) * C \<le> cmod (x *\<^sub>R z) / (r - cmod z) * C
[PROOF STEP]
apply (simp add: field_split_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cmod z < r; 0 \<le> x; x \<le> 1; 0 < r\<rbrakk> \<Longrightarrow> C * (x * (x * (cmod z * cmod z))) \<le> C * (x * (cmod z * cmod z))
[PROOF STEP]
by (simp add: \<open>0 < C\<close> mult.assoc mult_left_le_one_le ordered_comm_semiring_class.comm_mult_left_mono)
[PROOF STATE]
proof (state)
this:
cmod (x *\<^sub>R z) / (r - cmod (x *\<^sub>R z)) * C \<le> cmod (x *\<^sub>R z) / (r - cmod z) * C

goal (1 subgoal):
 1. cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod z * cmod z * x * C / (r - cmod z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (deriv f (x *\<^sub>R z) - deriv f 0) \<le> cmod (x *\<^sub>R z) / (r - cmod z) * C
[PROOF STEP]
have "norm (deriv f (x *\<^sub>R z) - deriv f 0) * norm z \<le> norm (x *\<^sub>R z)  / (r - norm z) * C * norm z"
[PROOF STATE]
proof (prove)
using this:
cmod (deriv f (x *\<^sub>R z) - deriv f 0) \<le> cmod (x *\<^sub>R z) / (r - cmod z) * C

goal (1 subgoal):
 1. cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod (x *\<^sub>R z) / (r - cmod z) * C * cmod z
[PROOF STEP]
by (rule mult_right_mono) simp
[PROOF STATE]
proof (state)
this:
cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod (x *\<^sub>R z) / (r - cmod z) * C * cmod z

goal (1 subgoal):
 1. cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod z * cmod z * x * C / (r - cmod z)
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
0 \<le> x
x \<le> 1
cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod (x *\<^sub>R z) / (r - cmod z) * C * cmod z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1
cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod (x *\<^sub>R z) / (r - cmod z) * C * cmod z

goal (1 subgoal):
 1. cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod z * cmod z * x * C / (r - cmod z)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
cmod (deriv f (x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod z * cmod z * x * C / (r - cmod z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?x; ?x \<le> 1\<rbrakk> \<Longrightarrow> cmod (deriv f (?x *\<^sub>R z) - deriv f 0) * cmod z \<le> cmod z * cmod z * ?x * C / (r - cmod z)

goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
have le_norm: "abc \<le> norm d - e \<Longrightarrow> norm(f - d) \<le> e \<Longrightarrow> abc \<le> norm f" for abc d e and f::complex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>abc \<le> cmod d - e; cmod (f - d) \<le> e\<rbrakk> \<Longrightarrow> abc \<le> cmod f
[PROOF STEP]
by (metis add_diff_cancel_left' add_diff_eq diff_left_mono norm_diff_ineq order_trans)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?abc \<le> cmod ?d - ?e; cmod (?f - ?d) \<le> ?e\<rbrakk> \<Longrightarrow> ?abc \<le> cmod ?f

goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
have "norm (integral {0..1} (\<lambda>x. (deriv f (x *\<^sub>R z) - deriv f 0) * z))
            \<le> integral {0..1} (\<lambda>t. (norm z)\<^sup>2 * t / (r - norm z) * C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (integral {0..1} (\<lambda>x. (deriv f (x *\<^sub>R z) - deriv f 0) * z)) \<le> integral {0..1} (\<lambda>t. (cmod z)\<^sup>2 * t / (r - cmod z) * C)
[PROOF STEP]
proof (rule integral_norm_bound_integral)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>x. (deriv f (x *\<^sub>R z) - deriv f 0) * z) integrable_on {0..1}
 2. (\<lambda>t. (cmod z)\<^sup>2 * t / (r - cmod z) * C) integrable_on {0..1}
 3. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod ((deriv f (x *\<^sub>R z) - deriv f 0) * z) \<le> (cmod z)\<^sup>2 * x / (r - cmod z) * C
[PROOF STEP]
show "(\<lambda>x. (deriv f (x *\<^sub>R z) - deriv f 0) * z) integrable_on {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (deriv f (x *\<^sub>R z) - deriv f 0) * z) integrable_on {0..1}
[PROOF STEP]
using contour_integral_primitive [OF 1, of "linepath 0 z"] 2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. x \<in> ball 0 r \<Longrightarrow> x \<in> ball 0 r; valid_path (linepath 0 z); path_image (linepath 0 z) \<subseteq> ball 0 r\<rbrakk> \<Longrightarrow> ((\<lambda>x. deriv f x - deriv f 0) has_contour_integral f (pathfinish (linepath 0 z)) - deriv f 0 * pathfinish (linepath 0 z) - (f (pathstart (linepath 0 z)) - deriv f 0 * pathstart (linepath 0 z))) (linepath 0 z)
closed_segment 0 z \<subseteq> ball 0 r

goal (1 subgoal):
 1. (\<lambda>x. (deriv f (x *\<^sub>R z) - deriv f 0) * z) integrable_on {0..1}
[PROOF STEP]
by (simp add: has_contour_integral_linepath has_integral_integrable_integral)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (deriv f (x *\<^sub>R z) - deriv f 0) * z) integrable_on {0..1}

goal (2 subgoals):
 1. (\<lambda>t. (cmod z)\<^sup>2 * t / (r - cmod z) * C) integrable_on {0..1}
 2. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod ((deriv f (x *\<^sub>R z) - deriv f 0) * z) \<le> (cmod z)\<^sup>2 * x / (r - cmod z) * C
[PROOF STEP]
have "(*) ((cmod z)\<^sup>2) integrable_on {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*) ((cmod z)\<^sup>2) integrable_on {0..1}
[PROOF STEP]
by (metis ident_integrable_on integrable_0 integrable_eq integrable_on_cmult_iff lambda_zero)
[PROOF STATE]
proof (state)
this:
(*) ((cmod z)\<^sup>2) integrable_on {0..1}

goal (2 subgoals):
 1. (\<lambda>t. (cmod z)\<^sup>2 * t / (r - cmod z) * C) integrable_on {0..1}
 2. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod ((deriv f (x *\<^sub>R z) - deriv f 0) * z) \<le> (cmod z)\<^sup>2 * x / (r - cmod z) * C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(*) ((cmod z)\<^sup>2) integrable_on {0..1}
[PROOF STEP]
show "(\<lambda>t. (norm z)\<^sup>2 * t / (r - norm z) * C) integrable_on {0..1}"
[PROOF STATE]
proof (prove)
using this:
(*) ((cmod z)\<^sup>2) integrable_on {0..1}

goal (1 subgoal):
 1. (\<lambda>t. (cmod z)\<^sup>2 * t / (r - cmod z) * C) integrable_on {0..1}
[PROOF STEP]
using integrable_on_cmult_right[where 'b=real, simplified] integrable_on_cdivide [where 'b=real, simplified]
[PROOF STATE]
proof (prove)
using this:
(*) ((cmod z)\<^sup>2) integrable_on {0..1}
?f integrable_on ?s \<Longrightarrow> (\<lambda>x. ?f x * ?c) integrable_on ?s
?f integrable_on ?s \<Longrightarrow> (\<lambda>x. ?f x / ?c) integrable_on ?s

goal (1 subgoal):
 1. (\<lambda>t. (cmod z)\<^sup>2 * t / (r - cmod z) * C) integrable_on {0..1}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>t. (cmod z)\<^sup>2 * t / (r - cmod z) * C) integrable_on {0..1}

goal (1 subgoal):
 1. \<And>x. x \<in> {0..1} \<Longrightarrow> cmod ((deriv f (x *\<^sub>R z) - deriv f 0) * z) \<le> (cmod z)\<^sup>2 * x / (r - cmod z) * C
[PROOF STEP]
qed (simp add: norm_mult power2_eq_square 4)
[PROOF STATE]
proof (state)
this:
cmod (integral {0..1} (\<lambda>x. (deriv f (x *\<^sub>R z) - deriv f 0) * z)) \<le> integral {0..1} (\<lambda>t. (cmod z)\<^sup>2 * t / (r - cmod z) * C)

goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod (integral {0..1} (\<lambda>x. (deriv f (x *\<^sub>R z) - deriv f 0) * z)) \<le> integral {0..1} (\<lambda>t. (cmod z)\<^sup>2 * t / (r - cmod z) * C)
[PROOF STEP]
have int_le: "norm (f z - deriv f 0 * z) \<le> (norm z)\<^sup>2 * norm(deriv f 0) / ((r - norm z))"
[PROOF STATE]
proof (prove)
using this:
cmod (integral {0..1} (\<lambda>x. (deriv f (x *\<^sub>R z) - deriv f 0) * z)) \<le> integral {0..1} (\<lambda>t. (cmod z)\<^sup>2 * t / (r - cmod z) * C)

goal (1 subgoal):
 1. cmod (f z - deriv f 0 * z) \<le> (cmod z)\<^sup>2 * cmod (deriv f 0) / (r - cmod z)
[PROOF STEP]
using contour_integral_primitive [OF 1, of "linepath 0 z"] 2
[PROOF STATE]
proof (prove)
using this:
cmod (integral {0..1} (\<lambda>x. (deriv f (x *\<^sub>R z) - deriv f 0) * z)) \<le> integral {0..1} (\<lambda>t. (cmod z)\<^sup>2 * t / (r - cmod z) * C)
\<lbrakk>\<And>x. x \<in> ball 0 r \<Longrightarrow> x \<in> ball 0 r; valid_path (linepath 0 z); path_image (linepath 0 z) \<subseteq> ball 0 r\<rbrakk> \<Longrightarrow> ((\<lambda>x. deriv f x - deriv f 0) has_contour_integral f (pathfinish (linepath 0 z)) - deriv f 0 * pathfinish (linepath 0 z) - (f (pathstart (linepath 0 z)) - deriv f 0 * pathstart (linepath 0 z))) (linepath 0 z)
closed_segment 0 z \<subseteq> ball 0 r

goal (1 subgoal):
 1. cmod (f z - deriv f 0 * z) \<le> (cmod z)\<^sup>2 * cmod (deriv f 0) / (r - cmod z)
[PROOF STEP]
by (simp add: has_contour_integral_linepath has_integral_integrable_integral C_def)
[PROOF STATE]
proof (state)
this:
cmod (f z - deriv f 0 * z) \<le> (cmod z)\<^sup>2 * cmod (deriv f 0) / (r - cmod z)

goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
have "norm z * (norm (deriv f 0) * (r - norm z - norm z)) \<le> norm z * (norm (deriv f 0) * (r - norm z) - norm (deriv f 0) * norm z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod z * (cmod (deriv f 0) * (r - cmod z - cmod z)) \<le> cmod z * (cmod (deriv f 0) * (r - cmod z) - cmod (deriv f 0) * cmod z)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
cmod z * (cmod (deriv f 0) * (r - cmod z - cmod z)) \<le> cmod z * (cmod (deriv f 0) * (r - cmod z) - cmod (deriv f 0) * cmod z)

goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod z * (cmod (deriv f 0) * (r - cmod z - cmod z)) \<le> cmod z * (cmod (deriv f 0) * (r - cmod z) - cmod (deriv f 0) * cmod z)
[PROOF STEP]
have \<section>: "(norm z * (r - norm z) - norm z * norm z) * norm (deriv f 0) \<le> norm (deriv f 0) * norm z * (r - norm z) - norm z * norm z * norm (deriv f 0)"
[PROOF STATE]
proof (prove)
using this:
cmod z * (cmod (deriv f 0) * (r - cmod z - cmod z)) \<le> cmod z * (cmod (deriv f 0) * (r - cmod z) - cmod (deriv f 0) * cmod z)

goal (1 subgoal):
 1. (cmod z * (r - cmod z) - cmod z * cmod z) * cmod (deriv f 0) \<le> cmod (deriv f 0) * cmod z * (r - cmod z) - cmod z * cmod z * cmod (deriv f 0)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(cmod z * (r - cmod z) - cmod z * cmod z) * cmod (deriv f 0) \<le> cmod (deriv f 0) * cmod z * (r - cmod z) - cmod z * cmod z * cmod (deriv f 0)

goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
apply (rule le_norm [OF _ int_le])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (deriv f 0 * z) - (cmod z)\<^sup>2 * cmod (deriv f 0) / (r - cmod z)
[PROOF STEP]
using \<open>norm z < r\<close>
[PROOF STATE]
proof (prove)
using this:
cmod z < r

goal (1 subgoal):
 1. (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (deriv f 0 * z) - (cmod z)\<^sup>2 * cmod (deriv f 0) / (r - cmod z)
[PROOF STEP]
by (simp add: power2_eq_square divide_simps C_def norm_mult \<section>)
[PROOF STATE]
proof (state)
this:
(cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0) \<le> cmod (f z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cmod ?z < r \<Longrightarrow> (cmod ?z - (cmod ?z)\<^sup>2 / (r - cmod ?z)) * cmod (deriv f 0) \<le> cmod (f ?z)

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
have sq201 [simp]: "0 < (1 - sqrt 2 / 2)" "(1 - sqrt 2 / 2)  < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 - sqrt 2 / 2 &&& 1 - sqrt 2 / 2 < 1
[PROOF STEP]
by (auto simp:  sqrt2_less_2)
[PROOF STATE]
proof (state)
this:
0 < 1 - sqrt 2 / 2
1 - sqrt 2 / 2 < 1

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
have 1: "continuous_on (closure (ball 0 ((1 - sqrt 2 / 2) * r))) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (closure (ball 0 ((1 - sqrt 2 / 2) * r))) f
[PROOF STEP]
proof (rule continuous_on_subset [OF holomorphic_on_imp_continuous_on [OF holf]])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure (ball 0 ((1 - sqrt 2 / 2) * r)) \<subseteq> cball 0 r
[PROOF STEP]
show "closure (ball 0 ((1 - sqrt 2 / 2) * r)) \<subseteq> cball 0 r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (ball (0::'a) ((1 - sqrt 2 / 2) * r)) \<subseteq> cball (0::'a) r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure (ball (0::'a) ((1 - sqrt 2 / 2) * r)) \<subseteq> cball (0::'a) r
[PROOF STEP]
have "(1 - sqrt 2 / 2) * r \<le> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - sqrt 2 / 2) * r \<le> r
[PROOF STEP]
by (simp add: \<open>0 < r\<close>)
[PROOF STATE]
proof (state)
this:
(1 - sqrt 2 / 2) * r \<le> r

goal (1 subgoal):
 1. closure (ball (0::'a) ((1 - sqrt 2 / 2) * r)) \<subseteq> cball (0::'a) r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 - sqrt 2 / 2) * r \<le> r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(1 - sqrt 2 / 2) * r \<le> r

goal (1 subgoal):
 1. closure (ball (0::'a) ((1 - sqrt 2 / 2) * r)) \<subseteq> cball (0::'a) r
[PROOF STEP]
by (meson ball_subset_cball closed_cball closure_minimal dual_order.trans subset_ball)
[PROOF STATE]
proof (state)
this:
closure (ball (0::'a) ((1 - sqrt 2 / 2) * r)) \<subseteq> cball (0::'a) r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
closure (ball (0::?'a1) ((1 - sqrt 2 / 2) * r)) \<subseteq> cball (0::?'a1) r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on (closure (ball 0 ((1 - sqrt 2 / 2) * r))) f

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
have 2: "open (f ` interior (ball 0 ((1 - sqrt 2 / 2) * r)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (f ` interior (ball 0 ((1 - sqrt 2 / 2) * r)))
[PROOF STEP]
proof (rule open_mapping_thm [OF holf' open_ball connected_ball])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. open (interior (ball 0 ((1 - sqrt 2 / 2) * r)))
 2. interior (ball 0 ((1 - sqrt 2 / 2) * r)) \<subseteq> ball 0 r
 3. \<not> f constant_on ball 0 r
[PROOF STEP]
show "interior (ball 0 ((1 - sqrt 2 / 2) * r)) \<subseteq> ball (0::complex) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (ball 0 ((1 - sqrt 2 / 2) * r)) \<subseteq> ball 0 r
[PROOF STEP]
using \<open>0 < r\<close> mult_pos_pos sq201
[PROOF STATE]
proof (prove)
using this:
0 < r
\<lbrakk>(0::?'a) < ?a; (0::?'a) < ?b\<rbrakk> \<Longrightarrow> (0::?'a) < ?a * ?b
0 < 1 - sqrt 2 / 2
1 - sqrt 2 / 2 < 1

goal (1 subgoal):
 1. interior (ball 0 ((1 - sqrt 2 / 2) * r)) \<subseteq> ball 0 r
[PROOF STEP]
by (simp add: ball_subset_ball_iff)
[PROOF STATE]
proof (state)
this:
interior (ball 0 ((1 - sqrt 2 / 2) * r)) \<subseteq> ball 0 r

goal (2 subgoals):
 1. open (interior (ball 0 ((1 - sqrt 2 / 2) * r)))
 2. \<not> f constant_on ball 0 r
[PROOF STEP]
show "\<not> f constant_on ball 0 r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> f constant_on ball 0 r
[PROOF STEP]
using False \<open>0 < r\<close> centre_in_ball holf' holomorphic_nonconstant
[PROOF STATE]
proof (prove)
using this:
deriv f 0 \<noteq> 0
0 < r
(?x \<in> ball ?x ?e) = (0 < ?e)
f holomorphic_on ball 0 r
\<lbrakk>?f holomorphic_on ?S; open ?S; ?\<xi> \<in> ?S; deriv ?f ?\<xi> \<noteq> 0\<rbrakk> \<Longrightarrow> \<not> ?f constant_on ?S

goal (1 subgoal):
 1. \<not> f constant_on ball 0 r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> f constant_on ball 0 r

goal (1 subgoal):
 1. open (interior (ball 0 ((1 - sqrt 2 / 2) * r)))
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
open (f ` interior (ball 0 ((1 - sqrt 2 / 2) * r)))

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
have "ball 0 ((3 - 2 * sqrt 2) * r * norm (deriv f 0)) =
          ball (f 0) ((3 - 2 * sqrt 2) * r * norm (deriv f 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) = ball (f 0) ((3 - 2 * sqrt 2) * r * cmod (deriv f 0))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) = ball (f 0) ((3 - 2 * sqrt 2) * r * cmod (deriv f 0))

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) = ball (f 0) ((3 - 2 * sqrt 2) * r * cmod (deriv f 0))

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
have "...  \<subseteq> f ` ball 0 ((1 - sqrt 2 / 2) * r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball (f 0) ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 ((1 - sqrt 2 / 2) * r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ball (f 0) ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 ((1 - sqrt 2 / 2) * r)
[PROOF STEP]
have 3: "(3 - 2 * sqrt 2) * r * norm (deriv f 0) \<le> norm (f z)"
        if "norm z = (1 - sqrt 2 / 2) * r" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (3 - 2 * sqrt 2) * r * cmod (deriv f 0) \<le> cmod (f z)
[PROOF STEP]
apply (rule order_trans [OF _ *])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (3 - 2 * sqrt 2) * r * cmod (deriv f 0) \<le> (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0)
 2. cmod z < r
[PROOF STEP]
using  \<open>0 < r\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (2 subgoals):
 1. (3 - 2 * sqrt 2) * r * cmod (deriv f 0) \<le> (cmod z - (cmod z)\<^sup>2 / (r - cmod z)) * cmod (deriv f 0)
 2. cmod z < r
[PROOF STEP]
apply (simp_all add: field_simps power2_eq_square that)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < r \<Longrightarrow> 2 * cmod (deriv f 0) \<le> sqrt 2 * (sqrt 2 * cmod (deriv f 0))
[PROOF STEP]
apply (simp add: mult.assoc [symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cmod ?z = (1 - sqrt 2 / 2) * r \<Longrightarrow> (3 - 2 * sqrt 2) * r * cmod (deriv f 0) \<le> cmod (f ?z)

goal (1 subgoal):
 1. ball (f 0) ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 ((1 - sqrt 2 / 2) * r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball (f 0) ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 ((1 - sqrt 2 / 2) * r)
[PROOF STEP]
apply (rule ball_subset_open_map_image [OF 1 2 _ bounded_ball])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>z. z \<in> frontier (ball 0 ((1 - sqrt 2 / 2) * r)) \<Longrightarrow> (3 - 2 * sqrt 2) * r * cmod (deriv f 0) \<le> cmod (f z - f 0)
 2. 0 \<in> ball 0 ((1 - sqrt 2 / 2) * r)
 3. 0 < (3 - 2 * sqrt 2) * r * cmod (deriv f 0)
[PROOF STEP]
using \<open>0 < r\<close> sq201 3 C_def \<open>0 < C\<close> sq3
[PROOF STATE]
proof (prove)
using this:
0 < r
0 < 1 - sqrt 2 / 2
1 - sqrt 2 / 2 < 1
cmod ?z = (1 - sqrt 2 / 2) * r \<Longrightarrow> (3 - 2 * sqrt 2) * r * cmod (deriv f 0) \<le> cmod (f ?z)
C = 2 * cmod (deriv f 0)
0 < C
0 < 3 - 2 * sqrt 2

goal (3 subgoals):
 1. \<And>z. z \<in> frontier (ball 0 ((1 - sqrt 2 / 2) * r)) \<Longrightarrow> (3 - 2 * sqrt 2) * r * cmod (deriv f 0) \<le> cmod (f z - f 0)
 2. 0 \<in> ball 0 ((1 - sqrt 2 / 2) * r)
 3. 0 < (3 - 2 * sqrt 2) * r * cmod (deriv f 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ball (f 0) ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 ((1 - sqrt 2 / 2) * r)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ball (f 0) ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 ((1 - sqrt 2 / 2) * r)

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ball (f 0) ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 ((1 - sqrt 2 / 2) * r)

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
have "...  \<subseteq> f ` ball 0 r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` ball 0 ((1 - sqrt 2 / 2) * r) \<subseteq> f ` ball 0 r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f ` ball 0 ((1 - sqrt 2 / 2) * r) \<subseteq> f ` ball 0 r
[PROOF STEP]
have "\<And>x. (1 - sqrt 2 / 2) * r \<le> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (1 - sqrt 2 / 2) * r \<le> r
[PROOF STEP]
using \<open>0 < r\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. \<And>x. (1 - sqrt 2 / 2) * r \<le> r
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
(1 - sqrt 2 / 2) * r \<le> r

goal (1 subgoal):
 1. f ` ball 0 ((1 - sqrt 2 / 2) * r) \<subseteq> f ` ball 0 r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 - sqrt 2 / 2) * r \<le> r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(1 - sqrt 2 / 2) * r \<le> r

goal (1 subgoal):
 1. f ` ball 0 ((1 - sqrt 2 / 2) * r) \<subseteq> f ` ball 0 r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` ball 0 ((1 - sqrt 2 / 2) * r) \<subseteq> f ` ball 0 r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f ` ball 0 ((1 - sqrt 2 / 2) * r) \<subseteq> f ` ball 0 r

goal (1 subgoal):
 1. deriv f 0 \<noteq> 0 \<Longrightarrow> ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r

goal (1 subgoal):
 1. ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ball 0 ((3 - 2 * sqrt 2) * r * cmod (deriv f 0)) \<subseteq> f ` ball 0 r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vproductI[intro!]:
  assumes "vsv f" and "\<D>\<^sub>\<circ> f = I" and "\<forall>i\<in>\<^sub>\<circ>I. f\<lparr>i\<rparr> \<in>\<^sub>\<circ> A i"
  shows "f \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in>\<^sub>\<circ> vproduct I A
[PROOF STEP]
using assms small_vproduct
[PROOF STATE]
proof (prove)
using this:
vsv f
\<D>\<^sub>\<circ> f = I
\<forall>i\<in>elts I. f\<lparr>i\<rparr> \<in>\<^sub>\<circ> A i
small {f. vsv f \<and> \<D>\<^sub>\<circ> f = ?I \<and> (\<forall>i\<in>elts ?I. f\<lparr>i\<rparr> \<in>\<^sub>\<circ> ?A i)}

goal (1 subgoal):
 1. f \<in>\<^sub>\<circ> vproduct I A
[PROOF STEP]
unfolding vproduct_def
[PROOF STATE]
proof (prove)
using this:
vsv f
\<D>\<^sub>\<circ> f = I
\<forall>i\<in>elts I. f\<lparr>i\<rparr> \<in>\<^sub>\<circ> A i
small {f. vsv f \<and> \<D>\<^sub>\<circ> f = ?I \<and> (\<forall>i\<in>elts ?I. f\<lparr>i\<rparr> \<in>\<^sub>\<circ> ?A i)}

goal (1 subgoal):
 1. f \<in>\<^sub>\<circ> set {f. vsv f \<and> \<D>\<^sub>\<circ> f = I \<and> (\<forall>i\<in>elts I. f\<lparr>i\<rparr> \<in>\<^sub>\<circ> A i)}
[PROOF STEP]
by auto


[STATEMENT]
lemma tree_unique: \<comment>\<open> Adapted from @{cite [cite_macro=citet] "Matthews:1999"} for \emph{contractive functions}. \<close>
  fixes x :: "'a tree"
  assumes xfx: "x = f\<cdot>x"
  assumes f: "\<And>i t u. tree_take i\<cdot>t = tree_take i\<cdot>u
                      \<Longrightarrow> tree_take (Suc i)\<cdot>(f\<cdot>t) = tree_take (Suc i)\<cdot>(f\<cdot>u)"
  shows "x = fix\<cdot>f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = fix\<cdot>f
[PROOF STEP]
proof(rule tree.take_lemma)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. tree_take n\<cdot>x = tree_take n\<cdot>(fix\<cdot>f)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. tree_take n\<cdot>x = tree_take n\<cdot>(fix\<cdot>f)
[PROOF STEP]
show "tree_take i\<cdot>x = tree_take i\<cdot>(fix\<cdot>f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tree_take i\<cdot>x = tree_take i\<cdot>(fix\<cdot>f)
[PROOF STEP]
proof(induct i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. tree_take 0\<cdot>x = tree_take 0\<cdot>(fix\<cdot>f)
 2. \<And>i. tree_take i\<cdot>x = tree_take i\<cdot>(fix\<cdot>f) \<Longrightarrow> tree_take (Suc i)\<cdot>x = tree_take (Suc i)\<cdot>(fix\<cdot>f)
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
tree_take i\<cdot>x = tree_take i\<cdot>(fix\<cdot>f)

goal (2 subgoals):
 1. tree_take 0\<cdot>x = tree_take 0\<cdot>(fix\<cdot>f)
 2. \<And>i. tree_take i\<cdot>x = tree_take i\<cdot>(fix\<cdot>f) \<Longrightarrow> tree_take (Suc i)\<cdot>x = tree_take (Suc i)\<cdot>(fix\<cdot>f)
[PROOF STEP]
from xfx f[OF Suc, folded fix_eq]
[PROOF STATE]
proof (chain)
picking this:
x = f\<cdot>x
tree_take (Suc i)\<cdot>(f\<cdot>x) = tree_take (Suc i)\<cdot>(fix\<cdot>f)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x = f\<cdot>x
tree_take (Suc i)\<cdot>(f\<cdot>x) = tree_take (Suc i)\<cdot>(fix\<cdot>f)

goal (1 subgoal):
 1. tree_take (Suc i)\<cdot>x = tree_take (Suc i)\<cdot>(fix\<cdot>f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
tree_take (Suc i)\<cdot>x = tree_take (Suc i)\<cdot>(fix\<cdot>f)

goal (1 subgoal):
 1. tree_take 0\<cdot>x = tree_take 0\<cdot>(fix\<cdot>f)
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
tree_take i\<cdot>x = tree_take i\<cdot>(fix\<cdot>f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isCont_arcsin: "-1 < x \<Longrightarrow> x < 1 \<Longrightarrow> isCont arcsin x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- 1 < x; x < 1\<rbrakk> \<Longrightarrow> isCont arcsin x
[PROOF STEP]
using continuous_on_arcsin'[THEN continuous_on_subset, of "{ -1 <..< 1 }"]
[PROOF STATE]
proof (prove)
using this:
{- 1<..<1} \<subseteq> {- 1..1} \<Longrightarrow> continuous_on {- 1<..<1} arcsin

goal (1 subgoal):
 1. \<lbrakk>- 1 < x; x < 1\<rbrakk> \<Longrightarrow> isCont arcsin x
[PROOF STEP]
by (auto simp: continuous_on_eq_continuous_at subset_eq)


[STATEMENT]
lemma euclidean_relation_polyI [case_names by0 divides euclidean_relation]:
  \<open>(x div y, x mod y) = (q, r)\<close>
    if by0: \<open>y = 0 \<Longrightarrow> q = 0 \<and> r = x\<close>
    and divides: \<open>y \<noteq> 0 \<Longrightarrow> y dvd x \<Longrightarrow> r = 0 \<and> x = q * y\<close>
    and euclidean_relation: \<open>y \<noteq> 0 \<Longrightarrow> \<not> y dvd x \<Longrightarrow> degree r < degree y \<and> x = q * y + r\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x div y, x mod y) = (q, r)
[PROOF STEP]
by (rule euclidean_relationI)
    (use that in \<open>simp_all add: euclidean_size_poly_def\<close>)


[STATEMENT]
lemma exposed_face_of_Int_supporting_hyperplane_le:
   "\<lbrakk>convex S; \<And>x. x \<in> S \<Longrightarrow> a \<bullet> x \<le> b\<rbrakk> \<Longrightarrow> (S \<inter> {x. a \<bullet> x = b}) exposed_face_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>convex S; \<And>x. x \<in> S \<Longrightarrow> a \<bullet> x \<le> b\<rbrakk> \<Longrightarrow> S \<inter> {x. a \<bullet> x = b} exposed_face_of S
[PROOF STEP]
by (force simp: exposed_face_of_def face_of_Int_supporting_hyperplane_le)


[STATEMENT]
lemma linear_independent_extend:
  "vs1.independent B \<Longrightarrow> \<exists>g. linear s1 s2 g \<and> (\<forall>x\<in>B. g x = f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs1.independent B \<Longrightarrow> \<exists>g. linear (*a) (*b) g \<and> (\<forall>x\<in>B. g x = f x)
[PROOF STEP]
using linear_independent_extend_subspace[of B f]
[PROOF STATE]
proof (prove)
using this:
vs1.independent B \<Longrightarrow> \<exists>g. linear (*a) (*b) g \<and> (\<forall>x\<in>B. g x = f x) \<and> range g = vs2.span (f ` B)

goal (1 subgoal):
 1. vs1.independent B \<Longrightarrow> \<exists>g. linear (*a) (*b) g \<and> (\<forall>x\<in>B. g x = f x)
[PROOF STEP]
by auto


[STATEMENT]
lemma differentiable_cmult_right_iff [simp]:
  fixes c::"'a::real_normed_field"
  shows "(\<lambda>t. q t * c) differentiable at t \<longleftrightarrow> c = 0 \<or> (\<lambda>t. q t) differentiable at t" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. q t * c) differentiable at t) = (c = (0::'a) \<or> q differentiable at t)
[PROOF STEP]
by (simp add: mult.commute flip: differentiable_cmult_left_iff)


[STATEMENT]
lemma delete_edges_length: "length (edgesL (delete_edges G f)) \<le> length (edgesL G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (edgesL (FiniteListGraph.delete_edges G f)) \<le> length (edgesL G)
[PROOF STEP]
proof (induction f arbitrary:G)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>G. length (edgesL (FiniteListGraph.delete_edges G [])) \<le> length (edgesL G)
 2. \<And>a f G. (\<And>G. length (edgesL (FiniteListGraph.delete_edges G f)) \<le> length (edgesL G)) \<Longrightarrow> length (edgesL (FiniteListGraph.delete_edges G (a # f))) \<le> length (edgesL G)
[PROOF STEP]
case (Cons f fs)
[PROOF STATE]
proof (state)
this:
length (edgesL (FiniteListGraph.delete_edges ?G fs)) \<le> length (edgesL ?G)

goal (2 subgoals):
 1. \<And>G. length (edgesL (FiniteListGraph.delete_edges G [])) \<le> length (edgesL G)
 2. \<And>a f G. (\<And>G. length (edgesL (FiniteListGraph.delete_edges G f)) \<le> length (edgesL G)) \<Longrightarrow> length (edgesL (FiniteListGraph.delete_edges G (a # f))) \<le> length (edgesL G)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
length (edgesL (FiniteListGraph.delete_edges ?G fs)) \<le> length (edgesL ?G)

goal (1 subgoal):
 1. length (edgesL (FiniteListGraph.delete_edges G (f # fs))) \<le> length (edgesL G)
[PROOF STEP]
apply (cases f, hypsubst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>\<And>G. length (edgesL (FiniteListGraph.delete_edges G fs)) \<le> length (edgesL G); \<And>G. length (edgesL (FiniteListGraph.delete_edges G fs)) \<le> length (edgesL G); f = (a, b)\<rbrakk> \<Longrightarrow> length (edgesL (FiniteListGraph.delete_edges G ((a, b) # fs))) \<le> length (edgesL G)
[PROOF STEP]
apply (subst delete_edges.simps(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>\<And>G. length (edgesL (FiniteListGraph.delete_edges G fs)) \<le> length (edgesL G); \<And>G. length (edgesL (FiniteListGraph.delete_edges G fs)) \<le> length (edgesL G); f = (a, b)\<rbrakk> \<Longrightarrow> length (edgesL (FiniteListGraph.delete_edges (FiniteListGraph.delete_edge a b G) fs)) \<le> length (edgesL G)
[PROOF STEP]
apply (metis delete_edge_length le_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
length (edgesL (FiniteListGraph.delete_edges G (f # fs))) \<le> length (edgesL G)

goal (1 subgoal):
 1. \<And>G. length (edgesL (FiniteListGraph.delete_edges G [])) \<le> length (edgesL G)
[PROOF STEP]
qed simp


[STATEMENT]
theorem lift_preserves_beta': "r \<rightarrow>\<^sub>\<beta>\<^sup>* s \<Longrightarrow> lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift s i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<rightarrow>\<^sub>\<beta>\<^sup>* s \<Longrightarrow> lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift s i
[PROOF STEP]
apply (induct set: rtranclp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift r i
 2. \<And>y z. \<lbrakk>r \<rightarrow>\<^sub>\<beta>\<^sup>* y; y \<rightarrow>\<^sub>\<beta> z; lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift y i\<rbrakk> \<Longrightarrow> lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift z i
[PROOF STEP]
apply (rule rtranclp.rtrancl_refl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>r \<rightarrow>\<^sub>\<beta>\<^sup>* y; y \<rightarrow>\<^sub>\<beta> z; lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift y i\<rbrakk> \<Longrightarrow> lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift z i
[PROOF STEP]
apply (erule rtranclp.rtrancl_into_rtrancl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>r \<rightarrow>\<^sub>\<beta>\<^sup>* y; y \<rightarrow>\<^sub>\<beta> z\<rbrakk> \<Longrightarrow> lift y i \<rightarrow>\<^sub>\<beta> lift z i
[PROOF STEP]
apply (erule lift_preserves_beta)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma from_list_correct_presentation:
  assumes "valid_wgraph_repr l"
  shows "let gi=from_list l; g=\<alpha>g gi; w=\<alpha>w gi in
      invar gi
    \<and> nodes g = \<Union>{{u,v} | u v. \<exists>d. ((u,v),d)\<in>set l}
    \<and> edges g = \<Union>{{(u,v),(v,u)} | u v. \<exists>d. ((u,v),d)\<in>set l}
    \<and> (\<forall>((u,v),d)\<in>set l. w {u,v}=d)
  "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let gi = from_list l; g = \<alpha>g gi; w = \<alpha>w gi in invar gi \<and> nodes g = \<Union> {{u, v} |u v. \<exists>d. ((u, v), d) \<in> set l} \<and> edges g = \<Union> {{(u, v), (v, u)} |u v. \<exists>d. ((u, v), d) \<in> set l} \<and> (\<forall>((u, v), d)\<in>set l. w {u, v} = d)
[PROOF STEP]
unfolding Let_def from_list_correct(2-3)[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar (from_list l) \<and> fst ` fst ` set l \<union> snd ` fst ` set l = \<Union> {{u, v} |u v. \<exists>d. ((u, v), d) \<in> set l} \<and> fst ` set l \<union> (fst ` set l)\<inverse> = \<Union> {{(u, v), (v, u)} |u v. \<exists>d. ((u, v), d) \<in> set l} \<and> Ball (set l) (case_prod (\<lambda>(u, v). (=) (\<alpha>w (from_list l) {u, v})))
[PROOF STEP]
apply (intro conjI)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. invar (from_list l)
 2. fst ` fst ` set l \<union> snd ` fst ` set l = \<Union> {{u, v} |u v. \<exists>d. ((u, v), d) \<in> set l}
 3. fst ` set l \<union> (fst ` set l)\<inverse> = \<Union> {{(u, v), (v, u)} |u v. \<exists>d. ((u, v), d) \<in> set l}
 4. Ball (set l) (case_prod (\<lambda>(u, v). (=) (\<alpha>w (from_list l) {u, v})))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar (from_list l)
[PROOF STEP]
by (simp add: from_list_correct(1)[OF assms])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. fst ` fst ` set l \<union> snd ` fst ` set l = \<Union> {{u, v} |u v. \<exists>d. ((u, v), d) \<in> set l}
 2. fst ` set l \<union> (fst ` set l)\<inverse> = \<Union> {{(u, v), (v, u)} |u v. \<exists>d. ((u, v), d) \<in> set l}
 3. Ball (set l) (case_prod (\<lambda>(u, v). (=) (\<alpha>w (from_list l) {u, v})))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` fst ` set l \<union> snd ` fst ` set l = \<Union> {{u, v} |u v. \<exists>d. ((u, v), d) \<in> set l}
[PROOF STEP]
by (auto 0 0 simp: in_set_conv_decomp; blast)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. fst ` set l \<union> (fst ` set l)\<inverse> = \<Union> {{(u, v), (v, u)} |u v. \<exists>d. ((u, v), d) \<in> set l}
 2. Ball (set l) (case_prod (\<lambda>(u, v). (=) (\<alpha>w (from_list l) {u, v})))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` set l \<union> (fst ` set l)\<inverse> = \<Union> {{(u, v), (v, u)} |u v. \<exists>d. ((u, v), d) \<in> set l}
[PROOF STEP]
by (auto 0 0 simp: in_set_conv_decomp; blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball (set l) (case_prod (\<lambda>(u, v). (=) (\<alpha>w (from_list l) {u, v})))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball (set l) (case_prod (\<lambda>(u, v). (=) (\<alpha>w (from_list l) {u, v})))
[PROOF STEP]
using from_list_correct(4)[OF assms]
[PROOF STATE]
proof (prove)
using this:
((?u, ?v), ?d) \<in> set l \<Longrightarrow> \<alpha>w (from_list l) {?u, ?v} = ?d

goal (1 subgoal):
 1. Ball (set l) (case_prod (\<lambda>(u, v). (=) (\<alpha>w (from_list l) {u, v})))
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma valid_shallow_model': "valid_net (shallow_model' Z M N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_net (shallow_model' Z M N)
[PROOF STEP]
apply (induction N)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. valid_net (shallow_model' Z M 0)
 2. \<And>N. valid_net (shallow_model' Z M N) \<Longrightarrow> valid_net (shallow_model' Z M (Suc N))
[PROOF STEP]
unfolding shallow_model'.simps
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. valid_net (Conv (Z, M) (Input M))
 2. \<And>N. valid_net (shallow_model' Z M N) \<Longrightarrow> valid_net (Pool (Conv (Z, M) (Input M)) (shallow_model' Z M N))
[PROOF STEP]
by (simp add: valid_net.intros, metis shallow_model'.elims shallow_model'.simps(1) valid_net.intros output_size.simps)


[STATEMENT]
lemma sH_g_orbital: "\<^bold>{P\<^bold>} (x\<acute>= f & G on U S @ t\<^sub>0) \<^bold>{Q\<^bold>} =
  (\<forall>s. P s \<longrightarrow> (\<forall>X\<in>ivp_sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> Q (X t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>{P\<^bold>}x\<acute>=f & G on U S @ t\<^sub>0\<^bold>{Q\<^bold>} = (\<forall>s. P s \<longrightarrow> (\<forall>X\<in>Sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> Q (X t)))
[PROOF STEP]
unfolding g_orbital_eq g_ode_def rel_kat_H
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>s s'. P s \<longrightarrow> (s, s') \<in> {(s, s') |s s'. s' \<in> {X t |t X. t \<in> U s \<and> \<P> X (down (U s) t) \<subseteq> Collect G \<and> X \<in> Sols f U S t\<^sub>0 s}} \<longrightarrow> Q s') = (\<forall>s. P s \<longrightarrow> (\<forall>X\<in>Sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> Q (X t)))
[PROOF STEP]
by auto


[STATEMENT]
lemma ordering_INTER_0:
"\<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n\<rbrakk>
 \<Longrightarrow> ordering (\<Inter>n. A n) 0 = oLimit (\<lambda>n. ordering (A n) 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n\<rbrakk> \<Longrightarrow> OrdinalVeblen.ordering (\<Inter> (range A)) 0 = oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0)
[PROOF STEP]
apply (subst ordering_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n\<rbrakk> \<Longrightarrow> (LEAST z. z \<in> \<Inter> (range A)) = oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0)
[PROOF STEP]
apply (rule Least_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0) \<in> \<Inter> (range A)
 2. \<And>y. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; y \<in> \<Inter> (range A)\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0) \<le> y
[PROOF STEP]
apply (rule oLimit_mem_INTER, assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n\<rbrakk> \<Longrightarrow> \<forall>n. OrdinalVeblen.ordering (A n) 0 \<in> A n
 2. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n\<rbrakk> \<Longrightarrow> mono (\<lambda>n. OrdinalVeblen.ordering (A n) 0)
 3. \<And>y. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; y \<in> \<Inter> (range A)\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0) \<le> y
[PROOF STEP]
apply (simp add: normal_set.ordering_mem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n\<rbrakk> \<Longrightarrow> mono (\<lambda>n. OrdinalVeblen.ordering (A n) 0)
 2. \<And>y. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; y \<in> \<Inter> (range A)\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0) \<le> y
[PROOF STEP]
apply (rule mono_natI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n\<rbrakk> \<Longrightarrow> OrdinalVeblen.ordering (A n) 0 \<le> OrdinalVeblen.ordering (A (Suc n)) 0
 2. \<And>y. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; y \<in> \<Inter> (range A)\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0) \<le> y
[PROOF STEP]
apply (simp add: ordering_0)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n\<rbrakk> \<Longrightarrow> (LEAST z. z \<in> A n) \<le> (LEAST z. z \<in> A (Suc n))
 2. \<And>y. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; y \<in> \<Inter> (range A)\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0) \<le> y
[PROOF STEP]
apply (rule Least_le)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n\<rbrakk> \<Longrightarrow> (LEAST z. z \<in> A (Suc n)) \<in> A n
 2. \<And>y. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; y \<in> \<Inter> (range A)\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0) \<le> y
[PROOF STEP]
apply (rule subsetD, erule spec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n\<rbrakk> \<Longrightarrow> (LEAST z. z \<in> A (Suc n)) \<in> A (Suc n)
 2. \<And>y. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; y \<in> \<Inter> (range A)\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0) \<le> y
[PROOF STEP]
apply (drule_tac x="Suc n" in spec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>\<forall>n. A (Suc n) \<subseteq> A n; normal_set (A (Suc n))\<rbrakk> \<Longrightarrow> (LEAST z. z \<in> A (Suc n)) \<in> A (Suc n)
 2. \<And>y. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; y \<in> \<Inter> (range A)\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0) \<le> y
[PROOF STEP]
apply (drule normal_set.unbounded, clarify)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n y. \<lbrakk>\<forall>n. A (Suc n) \<subseteq> A n; y \<in> A (Suc n); ?x18 n < y\<rbrakk> \<Longrightarrow> (LEAST z. z \<in> A (Suc n)) \<in> A (Suc n)
 2. \<And>y. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; y \<in> \<Inter> (range A)\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0) \<le> y
[PROOF STEP]
apply (erule LeastI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; y \<in> \<Inter> (range A)\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. OrdinalVeblen.ordering (A n) 0) \<le> y
[PROOF STEP]
apply (rule oLimit_leI[rule_format])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y n. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; y \<in> \<Inter> (range A)\<rbrakk> \<Longrightarrow> OrdinalVeblen.ordering (A n) 0 \<le> y
[PROOF STEP]
apply (simp add: ordering_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y n. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; \<forall>x. y \<in> A x\<rbrakk> \<Longrightarrow> (LEAST z. z \<in> A n) \<le> y
[PROOF STEP]
apply (rule Least_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y n. \<lbrakk>\<forall>n. normal_set (A n); \<forall>n. A (Suc n) \<subseteq> A n; \<forall>x. y \<in> A x\<rbrakk> \<Longrightarrow> y \<in> A n
[PROOF STEP]
apply (erule spec)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma image_mset_filter_swap2: \<open>{#C \<in># {#P x. x \<in># D#}. Q C #} = {#P x. x \<in># {#C| C \<in># D. Q (P C)#}#}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset Q (image_mset P D) = image_mset P {#C. C \<in># {#C \<in># D. Q (P C)#}#}
[PROOF STEP]
by (simp add: image_mset_filter_swap)


[STATEMENT]
lemma bin_rest_trunc: "(\<lambda>k::int. k div 2) ((take_bit :: nat \<Rightarrow> int \<Rightarrow> int) n bin) = (take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (n - 1) ((\<lambda>k::int. k div 2) bin)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit n bin div 2 = take_bit (n - 1) (bin div 2)
[PROOF STEP]
by (simp add: take_bit_rec [of n bin])