[STATEMENT]
lemma max_factor_degree_mono:
  "max_factor_degree (map degree (fold remove1 ws vs)) \<le> max_factor_degree (map degree vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_factor_degree (map degree (fold remove1 ws vs)) \<le> max_factor_degree (map degree vs)
[PROOF STEP]
unfolding max_factor_degree_def Let_def length_sort length_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (drop (length (fold remove1 ws vs) div 2) (sort (map degree (fold remove1 ws vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
proof (induct ws arbitrary: vs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>vs. sum_list (drop (length (fold remove1 [] vs) div 2) (sort (map degree (fold remove1 [] vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
 2. \<And>a ws vs. (\<And>vs. sum_list (drop (length (fold remove1 ws vs) div 2) (sort (map degree (fold remove1 ws vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))) \<Longrightarrow> sum_list (drop (length (fold remove1 (a # ws) vs) div 2) (sort (map degree (fold remove1 (a # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
case (Cons w ws vs)
[PROOF STATE]
proof (state)
this:
sum_list (drop (length (fold remove1 ws ?vs) div 2) (sort (map degree (fold remove1 ws ?vs)))) \<le> sum_list (drop (length ?vs div 2) (sort (map degree ?vs)))

goal (2 subgoals):
 1. \<And>vs. sum_list (drop (length (fold remove1 [] vs) div 2) (sort (map degree (fold remove1 [] vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
 2. \<And>a ws vs. (\<And>vs. sum_list (drop (length (fold remove1 ws vs) div 2) (sort (map degree (fold remove1 ws vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))) \<Longrightarrow> sum_list (drop (length (fold remove1 (a # ws) vs) div 2) (sort (map degree (fold remove1 (a # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
proof (cases "w \<in> set vs")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
 2. w \<notin> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
w \<notin> set vs

goal (2 subgoals):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
 2. w \<notin> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
hence "remove1 w vs = vs"
[PROOF STATE]
proof (prove)
using this:
w \<notin> set vs

goal (1 subgoal):
 1. remove1 w vs = vs
[PROOF STEP]
by (rule remove1_idem)
[PROOF STATE]
proof (state)
this:
remove1 w vs = vs

goal (2 subgoals):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
 2. w \<notin> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
remove1 w vs = vs

goal (1 subgoal):
 1. sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
using Cons[of vs]
[PROOF STATE]
proof (prove)
using this:
remove1 w vs = vs
sum_list (drop (length (fold remove1 ws vs) div 2) (sort (map degree (fold remove1 ws vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))

goal (1 subgoal):
 1. sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
w \<in> set vs

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> set vs
[PROOF STEP]
obtain bef aft where vs: "vs = bef @ w # aft" and rem1: "remove1 w vs = bef @ aft"
[PROOF STATE]
proof (prove)
using this:
w \<in> set vs

goal (1 subgoal):
 1. (\<And>bef aft. \<lbrakk>vs = bef @ w # aft; remove1 w vs = bef @ aft\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis remove1.simps(2) remove1_append split_list_first)
[PROOF STATE]
proof (state)
this:
vs = bef @ w # aft
remove1 w vs = bef @ aft

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
let ?exp = "\<lambda> ws vs. sum_list (drop (length (fold remove1 ws vs) div 2)
      (sort (map degree (fold remove1 ws vs))))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
let ?bnd = "\<lambda> vs. sum_list (drop (length vs div 2) (sort (map degree vs)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
let ?bd = "\<lambda> vs. sum_list (drop (length vs div 2) (sort vs))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
define ba where "ba = bef @ aft"
[PROOF STATE]
proof (state)
this:
ba = bef @ aft

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
define ds where "ds = map degree ba"
[PROOF STATE]
proof (state)
this:
ds = map degree ba

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
define d  where "d  = degree w"
[PROOF STATE]
proof (state)
this:
d = degree w

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
have "?exp (w # ws) vs = ?exp ws (bef @ aft)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) = sum_list (drop (length (fold remove1 ws (bef @ aft)) div 2) (sort (map degree (fold remove1 ws (bef @ aft)))))
[PROOF STEP]
by (auto simp: rem1)
[PROOF STATE]
proof (state)
this:
sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) = sum_list (drop (length (fold remove1 ws (bef @ aft)) div 2) (sort (map degree (fold remove1 ws (bef @ aft)))))

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) = sum_list (drop (length (fold remove1 ws (bef @ aft)) div 2) (sort (map degree (fold remove1 ws (bef @ aft)))))

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
have "\<dots> \<le> ?bnd ba"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (drop (length (fold remove1 ws (bef @ aft)) div 2) (sort (map degree (fold remove1 ws (bef @ aft))))) \<le> sum_list (drop (length ba div 2) (sort (map degree ba)))
[PROOF STEP]
unfolding ba_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (drop (length (fold remove1 ws (bef @ aft)) div 2) (sort (map degree (fold remove1 ws (bef @ aft))))) \<le> sum_list (drop (length (bef @ aft) div 2) (sort (map degree (bef @ aft))))
[PROOF STEP]
by (rule Cons)
[PROOF STATE]
proof (state)
this:
sum_list (drop (length (fold remove1 ws (bef @ aft)) div 2) (sort (map degree (fold remove1 ws (bef @ aft))))) \<le> sum_list (drop (length ba div 2) (sort (map degree ba)))

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (drop (length (fold remove1 ws (bef @ aft)) div 2) (sort (map degree (fold remove1 ws (bef @ aft))))) \<le> sum_list (drop (length ba div 2) (sort (map degree ba)))

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
have "\<dots> = ?bd ds"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (drop (length ba div 2) (sort (map degree ba))) = sum_list (drop (length ds div 2) (sort ds))
[PROOF STEP]
unfolding ds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (drop (length ba div 2) (sort (map degree ba))) = sum_list (drop (length (map degree ba) div 2) (sort (map degree ba)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (drop (length ba div 2) (sort (map degree ba))) = sum_list (drop (length ds div 2) (sort ds))

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (drop (length ba div 2) (sort (map degree ba))) = sum_list (drop (length ds div 2) (sort ds))

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
have "\<dots> \<le> sum_list (drop (Suc (length ds) div 2) (insort d (sort ds)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (drop (length ds div 2) (sort ds)) \<le> sum_list (drop (Suc (length ds) div 2) (insort d (sort ds)))
[PROOF STEP]
by (rule half_largest_elements_mono)
[PROOF STATE]
proof (state)
this:
sum_list (drop (length ds div 2) (sort ds)) \<le> sum_list (drop (Suc (length ds) div 2) (insort d (sort ds)))

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (drop (length ds div 2) (sort ds)) \<le> sum_list (drop (Suc (length ds) div 2) (insort d (sort ds)))

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
have "\<dots> = ?bnd vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (drop (Suc (length ds) div 2) (insort d (sort ds))) = sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
unfolding vs ds_def d_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (drop (Suc (length (map degree ba)) div 2) (insort (degree w) (sort (map degree ba)))) = sum_list (drop (length (bef @ w # aft) div 2) (sort (map degree (bef @ w # aft))))
[PROOF STEP]
by (simp add: ba_def insort_middle)
[PROOF STATE]
proof (state)
this:
sum_list (drop (Suc (length ds) div 2) (insort d (sort ds))) = sum_list (drop (length vs div 2) (sort (map degree vs)))

goal (1 subgoal):
 1. w \<in> set vs \<Longrightarrow> sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
show "?exp (w # ws) vs \<le> ?bnd vs"
[PROOF STATE]
proof (prove)
using this:
sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))

goal (1 subgoal):
 1. sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum_list (drop (length (fold remove1 (w # ws) vs) div 2) (sort (map degree (fold remove1 (w # ws) vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))

goal (1 subgoal):
 1. \<And>vs. sum_list (drop (length (fold remove1 [] vs) div 2) (sort (map degree (fold remove1 [] vs)))) \<le> sum_list (drop (length vs div 2) (sort (map degree vs)))
[PROOF STEP]
qed auto


[STATEMENT]
lemma coprime_prod_list:
  assumes "\<And>p. p \<in> set ps \<Longrightarrow> p \<noteq> 0"
  assumes "coprime (prod_list ps) (q::real poly)"
  shows "\<And>p. p \<in> set ps \<Longrightarrow> coprime p q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. p \<in> set ps \<Longrightarrow> comm_monoid_mult_class.coprime p q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> set ps \<Longrightarrow> comm_monoid_mult_class.coprime p q
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> set ps \<Longrightarrow> comm_monoid_mult_class.coprime p q
[PROOF STEP]
assume "p \<in> set ps"
[PROOF STATE]
proof (state)
this:
p \<in> set ps

goal (1 subgoal):
 1. \<And>p. p \<in> set ps \<Longrightarrow> comm_monoid_mult_class.coprime p q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> set ps
[PROOF STEP]
obtain r where r: "prod_list ps = r * p"
[PROOF STATE]
proof (prove)
using this:
p \<in> set ps

goal (1 subgoal):
 1. (\<And>r. prod_list ps = r * p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using remove1_retains_prod
[PROOF STATE]
proof (prove)
using this:
p \<in> set ps
?a \<in> set ?xs \<longrightarrow> prod_list ?xs = prod_list (remove1 ?a ?xs) * ?a

goal (1 subgoal):
 1. (\<And>r. prod_list ps = r * p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
prod_list ps = r * p

goal (1 subgoal):
 1. \<And>p. p \<in> set ps \<Longrightarrow> comm_monoid_mult_class.coprime p q
[PROOF STEP]
show "coprime p q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_monoid_mult_class.coprime p q
[PROOF STEP]
apply (rule coprime_prod[of r 1])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. r \<noteq> 0
 2. 1 \<noteq> 0
 3. comm_monoid_mult_class.coprime (r * p) (1 * q)
[PROOF STEP]
using assms r
[PROOF STATE]
proof (prove)
using this:
?p \<in> set ps \<Longrightarrow> ?p \<noteq> 0
comm_monoid_mult_class.coprime (prod_list ps) q
prod_list ps = r * p

goal (3 subgoals):
 1. r \<noteq> 0
 2. 1 \<noteq> 0
 3. comm_monoid_mult_class.coprime (r * p) (1 * q)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>p. p \<in> set ps \<Longrightarrow> p \<noteq> 0; 0 \<in> set ps; algebraic_semidom_class.coprime p q; r = 0; q \<noteq> 0; degree q = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
comm_monoid_mult_class.coprime p q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma equiv_subst_left:
  "cmp z y = comp \<longleftrightarrow> cmp x y = comp" if "cmp z x = Equiv" for comp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmp z y = comp) = (cmp x y = comp)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (cmp z y = comp) = (cmp x y = comp)
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
cmp z x = Equiv
[PROOF STEP]
have "cmp x z = Equiv"
[PROOF STATE]
proof (prove)
using this:
cmp z x = Equiv

goal (1 subgoal):
 1. cmp x z = Equiv
[PROOF STEP]
by (simp add: sym)
[PROOF STATE]
proof (state)
this:
cmp x z = Equiv

goal (1 subgoal):
 1. (cmp z y = comp) = (cmp x y = comp)
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
cmp z x = Equiv
cmp x z = Equiv
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmp z x = Equiv
cmp x z = Equiv

goal (1 subgoal):
 1. (cmp z y = comp) = (cmp x y = comp)
[PROOF STEP]
by (cases comp) (auto intro: trans_equiv trans_equiv_less trans_equiv_greater)
[PROOF STATE]
proof (state)
this:
(cmp z y = comp) = (cmp x y = comp)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_factors_mono:
  assumes "n \<subseteq># m"
  shows "mset_factors n \<subseteq> mset_factors m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_factors n \<subseteq> mset_factors m
[PROOF STEP]
unfolding mset_factors_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {na. na \<subseteq># n} \<subseteq> {n. n \<subseteq># m}
[PROOF STEP]
by (simp add: Collect_mono_iff assms subset_mset.order_trans)


[STATEMENT]
lemma append_subset:
  assumes "set xs = set (ys @ zs)"
  shows "set ys \<subseteq> set xs" and "set zs \<subseteq> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ys \<subseteq> set xs &&& set zs \<subseteq> set xs
[PROOF STEP]
by (metis Un_iff assms set_append subsetI)+


[STATEMENT]
lemma length_sorted_list_of_set [simp]: "length (sorted_list_of_set A) = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (sorted_list_of_set A) = card A
[PROOF STEP]
using distinct_card[of "sorted_list_of_set A"]
[PROOF STATE]
proof (prove)
using this:
distinct (sorted_list_of_set A) \<Longrightarrow> card (set (sorted_list_of_set A)) = length (sorted_list_of_set A)

goal (1 subgoal):
 1. length (sorted_list_of_set A) = card A
[PROOF STEP]
by (cases "finite A") simp_all


[STATEMENT]
lemma integralL_eq_0_iff:
  fixes f :: "real \<Rightarrow> real"
  assumes contf: "continuous_on {a..b} f" and "a < b"
    and "\<And>x. x \<in> {a..b} \<Longrightarrow> f x \<ge> 0"
  shows "integral\<^sup>L (lebesgue_on {a..b}) f = 0 \<longleftrightarrow> (\<forall>x \<in> {a..b}. f x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (integral\<^sup>L (lebesgue_on {a..b}) f = 0) = (\<forall>x\<in>{a..b}. f x = 0)
[PROOF STEP]
using integral_eq_0_iff [OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> {a..b} \<Longrightarrow> x \<in> {a..b}) \<Longrightarrow> (integral {a..b} f = 0) = (\<forall>x\<in>{a..b}. f x = 0)

goal (1 subgoal):
 1. (integral\<^sup>L (lebesgue_on {a..b}) f = 0) = (\<forall>x\<in>{a..b}. f x = 0)
[PROOF STEP]
by (simp add: contf continuous_imp_integrable_real lebesgue_integral_eq_integral)


[STATEMENT]
lemma infsetsum_cong_neutral:
  assumes "\<And>x. x \<in> A - B \<Longrightarrow> f x = 0"
  assumes "\<And>x. x \<in> B - A \<Longrightarrow> g x = 0"
  assumes "\<And>x. x \<in> A \<inter> B \<Longrightarrow> f x = g x"
  shows   "infsetsum f A = infsetsum g B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsetsum f A = infsetsum g B
[PROOF STEP]
unfolding infsetsum_altdef set_lebesgue_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|count_space UNIV. indicat_real A x *\<^sub>R f x = LINT x|count_space UNIV. indicat_real B x *\<^sub>R g x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> A - B \<Longrightarrow> f ?x = (0::'b)
?x \<in> B - A \<Longrightarrow> g ?x = (0::'b)
?x \<in> A \<inter> B \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. LINT x|count_space UNIV. indicat_real A x *\<^sub>R f x = LINT x|count_space UNIV. indicat_real B x *\<^sub>R g x
[PROOF STEP]
by (intro Bochner_Integration.integral_cong refl)
     (auto simp: indicator_def split: if_splits)


[STATEMENT]
lemma closure_of_Un [simp]: "X closure_of (S \<union> T) = X closure_of S \<union> X closure_of T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X closure_of (S \<union> T) = X closure_of S \<union> X closure_of T
[PROOF STEP]
by (simp add: Un_assoc Un_left_commute closure_of_alt derived_set_of_Un inf_sup_distrib1)


[STATEMENT]
lemma nonempty_card_pos1:"\<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> Suc 0 \<le> card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> Suc 0 \<le> card A
[PROOF STEP]
apply (frule nonempty_card_pos[of "A"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}; 0 < card A\<rbrakk> \<Longrightarrow> Suc 0 \<le> card A
[PROOF STEP]
apply (rule Suc_leI[of "0" "card A"], assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ex1_iff_Collect_singleton: "P x \<Longrightarrow> (\<exists>!x. P x) \<longleftrightarrow> Collect P = {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P x \<Longrightarrow> (\<exists>!x. P x) = (Collect P = {x})
[PROOF STEP]
by (subst ex1_imp_Collect_singleton[symmetric], auto)


[STATEMENT]
lemma isUb_UNIV_I: "(\<And>y. y \<in> S \<Longrightarrow> y \<le> u) \<Longrightarrow> isUb UNIV S u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> S \<Longrightarrow> y \<le> u) \<Longrightarrow> isUb UNIV S u
[PROOF STEP]
by (simp add: isUbI setleI)


[STATEMENT]
lemma has_vector_derivative_componentwise_within:
  "(f has_vector_derivative f') (at a within S) \<longleftrightarrow>
    (\<forall>i \<in> Basis. ((\<lambda>x. f x \<bullet> i) has_vector_derivative (f' \<bullet> i)) (at a within S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_vector_derivative f') (at a within S) = (\<forall>i\<in>Basis. ((\<lambda>x. f x \<bullet> i) has_vector_derivative f' \<bullet> i) (at a within S))
[PROOF STEP]
apply (simp add: has_vector_derivative_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_derivative (\<lambda>x. x *\<^sub>R f')) (at a within S) = (\<forall>i\<in>Basis. ((\<lambda>x. f x \<bullet> i) has_derivative (\<lambda>x. x * (f' \<bullet> i))) (at a within S))
[PROOF STEP]
apply (subst has_derivative_componentwise_within)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>Basis. ((\<lambda>x. f x \<bullet> i) has_derivative (\<lambda>x. x *\<^sub>R f' \<bullet> i)) (at a within S)) = (\<forall>i\<in>Basis. ((\<lambda>x. f x \<bullet> i) has_derivative (\<lambda>x. x * (f' \<bullet> i))) (at a within S))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma star_omega_1 [simp]: "x\<^sup>\<star> \<cdot> x\<^sup>\<omega> = x\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<star> \<cdot> x\<^sup>\<omega> = x\<^sup>\<omega>
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x\<^sup>\<star> \<cdot> x\<^sup>\<omega> \<le> x\<^sup>\<omega>
 2. x\<^sup>\<omega> \<le> x\<^sup>\<star> \<cdot> x\<^sup>\<omega>
[PROOF STEP]
have "x \<cdot> x\<^sup>\<omega> \<le> x\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> x\<^sup>\<omega> \<le> x\<^sup>\<omega>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<cdot> x\<^sup>\<omega> \<le> x\<^sup>\<omega>

goal (2 subgoals):
 1. x\<^sup>\<star> \<cdot> x\<^sup>\<omega> \<le> x\<^sup>\<omega>
 2. x\<^sup>\<omega> \<le> x\<^sup>\<star> \<cdot> x\<^sup>\<omega>
[PROOF STEP]
thus "x\<^sup>\<star> \<cdot> x\<^sup>\<omega> \<le> x\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
using this:
x \<cdot> x\<^sup>\<omega> \<le> x\<^sup>\<omega>

goal (1 subgoal):
 1. x\<^sup>\<star> \<cdot> x\<^sup>\<omega> \<le> x\<^sup>\<omega>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<cdot> x\<^sup>\<omega> \<le> x\<^sup>\<omega>

goal (1 subgoal):
 1. x\<^sup>\<omega> \<le> x\<^sup>\<star> \<cdot> x\<^sup>\<omega>
[PROOF STEP]
show "x\<^sup>\<omega> \<le> x\<^sup>\<star> \<cdot> x\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<omega> \<le> x\<^sup>\<star> \<cdot> x\<^sup>\<omega>
[PROOF STEP]
using local.star_inductl_var_eq2
[PROOF STATE]
proof (prove)
using this:
?y = ?x \<cdot> ?y \<Longrightarrow> ?y = ?x\<^sup>\<star> \<cdot> ?y

goal (1 subgoal):
 1. x\<^sup>\<omega> \<le> x\<^sup>\<star> \<cdot> x\<^sup>\<omega>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x\<^sup>\<omega> \<le> x\<^sup>\<star> \<cdot> x\<^sup>\<omega>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma onorm_pos_le:
  assumes f: "bounded_linear f"
  shows "0 \<le> onorm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> onorm f
[PROOF STEP]
using le_onorm [OF f, where x=0]
[PROOF STATE]
proof (prove)
using this:
norm (f (0::'a)) / norm (0::'a) \<le> onorm f

goal (1 subgoal):
 1. 0 \<le> onorm f
[PROOF STEP]
by simp


[STATEMENT]
lemma iT_Plus_neg_mem_iff2: "k \<le> x \<Longrightarrow> (x - k \<in> I \<oplus>- k) = (x \<in> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> x \<Longrightarrow> (x - k \<in> I \<oplus>- k) = (x \<in> I)
[PROOF STEP]
by (simp add: iT_Plus_neg_def)


[STATEMENT]
theorem connected: "connected T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Digraph_Component.connected T
[PROOF STEP]
unfolding connected_def strongly_connected_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. verts (with_proj (mk_symmetric T)) \<noteq> {} \<and> (\<forall>u\<in>verts (with_proj (mk_symmetric T)). \<forall>v\<in>verts (with_proj (mk_symmetric T)). u \<rightarrow>\<^sup>*\<^bsub>with_proj (mk_symmetric T)\<^esub> v)
[PROOF STEP]
using connected' root_in_T
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?u \<in> verts T; ?v \<in> verts T\<rbrakk> \<Longrightarrow> ?u \<rightarrow>\<^sup>*\<^bsub>with_proj (mk_symmetric T)\<^esub> ?v
root \<in> verts T

goal (1 subgoal):
 1. verts (with_proj (mk_symmetric T)) \<noteq> {} \<and> (\<forall>u\<in>verts (with_proj (mk_symmetric T)). \<forall>v\<in>verts (with_proj (mk_symmetric T)). u \<rightarrow>\<^sup>*\<^bsub>with_proj (mk_symmetric T)\<^esub> v)
[PROOF STEP]
by auto


[STATEMENT]
lemma inverse_distrib: "inverse (a * b)  =  (inverse a) * (inverse b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (a \<cdot> b) = inverse a \<cdot> inverse b
[PROOF STEP]
by (simp add: local.mult.inverse_distrib_swap mult_commute)


[STATEMENT]
lemma is_sentence_concat: "is_sentence (x@y) = (is_sentence x \<and> is_sentence y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_sentence (x @ y) = (is_sentence x \<and> is_sentence y)
[PROOF STEP]
by (auto simp add: is_sentence_def)


[STATEMENT]
lemma finite_zero_cardI [intro!]:
  "\<lbrakk> A = {}; finite A \<rbrakk> \<Longrightarrow> card A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = {}; finite A\<rbrakk> \<Longrightarrow> card A = 0
[PROOF STEP]
by (auto)


[STATEMENT]
theorem Crypt_Nonce_neq_Nonce: "Crypt K (Nonce M) \<noteq> Nonce N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Crypt K (Nonce M) \<noteq> Nonce N
[PROOF STEP]
by (auto simp add: Nonce_def Crypt dest: msgrel_imp_eq_freediscrim)


[STATEMENT]
lemma compute_power_up_fl[code]:
    "power_up_fl p x 0 = 1"
    "power_up_fl p x (Suc n) =
      (if odd n then float_round_up p ((power_up_fl p x (Suc n div 2))\<^sup>2)
       else float_round_up p (x * power_up_fl p x n))"
  and compute_power_down_fl[code]:
    "power_down_fl p x 0 = 1"
    "power_down_fl p x (Suc n) =
      (if odd n then float_round_down (Suc p) ((power_down_fl p x (Suc n div 2))\<^sup>2)
       else float_round_down (Suc p) (x * power_down_fl p x n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (power_up_fl p x 0 = 1 &&& power_up_fl p x (Suc n) = (if odd n then float_round_up p ((power_up_fl p x (Suc n div 2))\<^sup>2) else float_round_up p (x * power_up_fl p x n))) &&& power_down_fl p x 0 = 1 &&& power_down_fl p x (Suc n) = (if odd n then float_round_down (Suc p) ((power_down_fl p x (Suc n div 2))\<^sup>2) else float_round_down (Suc p) (x * power_down_fl p x n))
[PROOF STEP]
unfolding atomize_conj
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (power_up_fl p x 0 = 1 \<and> power_up_fl p x (Suc n) = (if odd n then float_round_up p ((power_up_fl p x (Suc n div 2))\<^sup>2) else float_round_up p (x * power_up_fl p x n))) \<and> power_down_fl p x 0 = 1 \<and> power_down_fl p x (Suc n) = (if odd n then float_round_down (Suc p) ((power_down_fl p x (Suc n div 2))\<^sup>2) else float_round_down (Suc p) (x * power_down_fl p x n))
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma Im_Ln_eq_pi: "z \<noteq> 0 \<Longrightarrow> (Im(Ln z) = pi \<longleftrightarrow> Re(z) < 0 \<and> Im(z) = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> (Im (Ln z) = pi) = (Re z < 0 \<and> Im z = 0)
[PROOF STEP]
using Im_Ln_eq_0 Im_Ln_pos_le Im_Ln_pos_lt complex.expand
[PROOF STATE]
proof (prove)
using this:
?z \<noteq> 0 \<Longrightarrow> (Im (Ln ?z) = 0) = (0 < Re ?z \<and> Im ?z = 0)
?z \<noteq> 0 \<Longrightarrow> (0 \<le> Im (Ln ?z) \<and> Im (Ln ?z) \<le> pi) = (0 \<le> Im ?z)
?z \<noteq> 0 \<Longrightarrow> (0 < Im (Ln ?z) \<and> Im (Ln ?z) < pi) = (0 < Im ?z)
Re ?complex = Re ?complex' \<and> Im ?complex = Im ?complex' \<Longrightarrow> ?complex = ?complex'

goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> (Im (Ln z) = pi) = (Re z < 0 \<and> Im z = 0)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma cinner_add_right: "cinner x (y + z) = cinner x y + cinner x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cinner x (y + z) = cinner x y + cinner x z
[PROOF STEP]
using cinner_add_left [of y z x]
[PROOF STATE]
proof (prove)
using this:
cinner (y + z) x = cinner y x + cinner z x

goal (1 subgoal):
 1. cinner x (y + z) = cinner x y + cinner x z
[PROOF STEP]
by (metis complex_cnj_add local.cinner_commute)


[STATEMENT]
lemma omega_loop_bot_nu:
  "\<nu> (\<lambda>x . y * x) = y\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu> (*) y = y\<^sup>\<omega>
[PROOF STEP]
by (metis greatest_fixpoint_same omega_loop_bot_is_greatest_fixpoint)


[STATEMENT]
lemma ALGxy_append: "ALGxy A (rs@[r]) init x y =
      ALGxy A rs init x y + (if (r \<in> {y,x}) then ALG' A (rs@[r]) init (length rs) y + ALG' A (rs@[r]) init (length rs) x else 0 )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
have "ALGxy A (rs@[r]) init x y = (\<Sum>i\<in>{..<(Suc (length rs))} \<inter> {i. (rs @ [r]) ! i \<in> {y, x}}.
       ALG' A (rs @ [r]) init i y +
       ALG' A (rs @ [r]) init i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ALGxy A (rs @ [r]) init x y = (\<Sum>i\<in>{..<Suc (length rs)} \<inter> {i. (rs @ [r]) ! i \<in> {y, x}}. ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x)
[PROOF STEP]
unfolding ALGxy_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{..<length (rs @ [r])} \<inter> {i. (rs @ [r]) ! i \<in> {y, x}}. ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x) = (\<Sum>i\<in>{..<Suc (length rs)} \<inter> {i. (rs @ [r]) ! i \<in> {y, x}}. ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x)
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
ALGxy A (rs @ [r]) init x y = (\<Sum>i\<in>{..<Suc (length rs)} \<inter> {i. (rs @ [r]) ! i \<in> {y, x}}. ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x)

goal (1 subgoal):
 1. ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ALGxy A (rs @ [r]) init x y = (\<Sum>i\<in>{..<Suc (length rs)} \<inter> {i. (rs @ [r]) ! i \<in> {y, x}}. ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x)

goal (1 subgoal):
 1. ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>{..<(Suc (length rs))}. (if i\<in>{i. (rs @ [r]) ! i \<in> {y, x}} then
       ALG' A (rs @ [r]) init i y +
       ALG' A (rs @ [r]) init i x else 0) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{..<Suc (length rs)} \<inter> {i. (rs @ [r]) ! i \<in> {y, x}}. ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x) = (\<Sum>i<Suc (length rs). if i \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0)
[PROOF STEP]
apply(rule sum.inter_restrict)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {..<Suc (length rs)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{..<Suc (length rs)} \<inter> {i. (rs @ [r]) ! i \<in> {y, x}}. ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x) = (\<Sum>i<Suc (length rs). if i \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0)

goal (1 subgoal):
 1. ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{..<Suc (length rs)} \<inter> {i. (rs @ [r]) ! i \<in> {y, x}}. ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x) = (\<Sum>i<Suc (length rs). if i \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0)

goal (1 subgoal):
 1. ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>{..<length rs}. (if i\<in>{i. (rs @ [r]) ! i \<in> {y, x}} then
       ALG' A (rs @ [r]) init i y +
       ALG' A (rs @ [r]) init i x else 0) ) + (if length rs\<in>{i. (rs @ [r]) ! i \<in> {y, x}} then
       ALG' A (rs @ [r]) init (length rs) y +
       ALG' A (rs @ [r]) init(length rs) x else 0) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<Suc (length rs). if i \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0) = (\<Sum>i<length rs. if i \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0) + (if length rs \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<Suc (length rs). if i \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0) = (\<Sum>i<length rs. if i \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0) + (if length rs \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)

goal (1 subgoal):
 1. ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<Suc (length rs). if i \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0) = (\<Sum>i<length rs. if i \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0) + (if length rs \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)

goal (1 subgoal):
 1. ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
have "\<dots> = ALGxy A rs init x y + (if r \<in> {y, x} then
       ALG' A (rs @ [r]) init (length rs) y +
       ALG' A (rs @ [r]) init(length rs) x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length rs. if i \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0) + (if length rs \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0) = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
apply(simp add: ALGxy_def sum.inter_restrict nth_append)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length rs. if rs ! i = y \<or> rs ! i = x then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0) = (\<Sum>xa<length rs. if rs ! xa = y \<or> rs ! xa = x then ALG' A rs init xa y + ALG' A rs init xa x else 0)
[PROOF STEP]
unfolding ALG'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length rs. if rs ! i = y \<or> rs ! i = x then E (map_pmf (\<lambda>x. real (ALG y (rs @ [r]) i x)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take i (rs @ [r])))) + E (map_pmf (\<lambda>xa. real (ALG x (rs @ [r]) i xa)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take i (rs @ [r])))) else 0) = (\<Sum>xa<length rs. if rs ! xa = y \<or> rs ! xa = x then E (map_pmf (\<lambda>x. real (ALG y rs xa x)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take xa rs))) + E (map_pmf (\<lambda>xb. real (ALG x rs xa xb)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take xa rs))) else 0)
[PROOF STEP]
apply(rule sum.cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {..<length rs} = {..<length rs}
 2. \<And>xa. xa \<in> {..<length rs} \<Longrightarrow> (if rs ! xa = y \<or> rs ! xa = x then E (map_pmf (\<lambda>x. real (ALG y (rs @ [r]) xa x)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take xa (rs @ [r])))) + E (map_pmf (\<lambda>xb. real (ALG x (rs @ [r]) xa xb)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take xa (rs @ [r])))) else 0) = (if rs ! xa = y \<or> rs ! xa = x then E (map_pmf (\<lambda>x. real (ALG y rs xa x)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take xa rs))) + E (map_pmf (\<lambda>xb. real (ALG x rs xa xb)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take xa rs))) else 0)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. xa \<in> {..<length rs} \<Longrightarrow> (if rs ! xa = y \<or> rs ! xa = x then E (map_pmf (\<lambda>x. real (ALG y (rs @ [r]) xa x)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take xa (rs @ [r])))) + E (map_pmf (\<lambda>xb. real (ALG x (rs @ [r]) xa xb)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take xa (rs @ [r])))) else 0) = (if rs ! xa = y \<or> rs ! xa = x then E (map_pmf (\<lambda>x. real (ALG y rs xa x)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take xa rs))) + E (map_pmf (\<lambda>xb. real (ALG x rs xa xb)) (Partial_Cost_Model.config'_rand A (fst A init \<bind> (\<lambda>is. return_pmf (init, is))) (take xa rs))) else 0)
[PROOF STEP]
by(auto simp: nth_append)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<length rs. if i \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init i y + ALG' A (rs @ [r]) init i x else 0) + (if length rs \<in> {i. (rs @ [r]) ! i \<in> {y, x}} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0) = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)

goal (1 subgoal):
 1. ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)

goal (1 subgoal):
 1. ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ALGxy A (rs @ [r]) init x y = ALGxy A rs init x y + (if r \<in> {y, x} then ALG' A (rs @ [r]) init (length rs) y + ALG' A (rs @ [r]) init (length rs) x else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nl31: "\<lbrakk> (l'::real) \<ge> 1; r' \<ge> 1; lr \<ge> 1; r \<ge> 1 \<rbrakk> \<Longrightarrow>
  4 * (l' + r') * (lr + r) \<le> (l' + lr + r' + r)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> l'; 1 \<le> r'; 1 \<le> lr; 1 \<le> r\<rbrakk> \<Longrightarrow> 4 * (l' + r') * (lr + r) \<le> (l' + lr + r' + r)\<^sup>2
[PROOF STEP]
by (sos "(((A<0 * R<1) + (R<1 * (R<1 * [r + ~1*l' + lr + ~1*r']^2))))")


[STATEMENT]
lemma application: fixes m1 m2
shows "\<forall>m1 m2.(mat nr nc m1)
              \<and>(mat nr nc m2)
              \<and>(\<forall> j < nc. \<forall> i < nr. m1 ! j ! i = m2 ! j ! i)
                  \<longrightarrow> (m1 = m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m1 m2. mat nr nc m1 \<and> mat nr nc m2 \<and> (\<forall>j<nc. \<forall>i<nr. m1 ! j ! i = m2 ! j ! i) \<longrightarrow> m1 = m2
[PROOF STEP]
using mat_eqI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mat ?nr ?nc ?m1.0; mat ?nr ?nc ?m2.0; \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> ?m1.0 ! i ! j = ?m2.0 ! i ! j\<rbrakk> \<Longrightarrow> ?m1.0 = ?m2.0

goal (1 subgoal):
 1. \<forall>m1 m2. mat nr nc m1 \<and> mat nr nc m2 \<and> (\<forall>j<nc. \<forall>i<nr. m1 ! j ! i = m2 ! j ! i) \<longrightarrow> m1 = m2
[PROOF STEP]
by blast


[STATEMENT]
lemma self_finance_updated_ind:
  assumes "portfolio pf"
  and "\<forall>n w. prices Mkt asset n w \<noteq> 0"
  shows "cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w +
    (prices Mkt asset (Suc n) w / (prices Mkt asset n w)) *
      (val_process Mkt (self_finance Mkt v pf asset) n w -
     val_process Mkt pf n w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
 2. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
 2. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
using assms self_finance_updated_suc_0
[PROOF STATE]
proof (prove)
using this:
n = 0
portfolio pf
\<forall>n w. prices Mkt asset n w \<noteq> 0
\<lbrakk>portfolio ?pf; \<forall>n w. prices ?Mkt ?asset n w \<noteq> 0\<rbrakk> \<Longrightarrow> cls_val_process ?Mkt (self_finance ?Mkt ?v ?pf ?asset) (Suc 0) ?w = cls_val_process ?Mkt ?pf (Suc 0) ?w + prices ?Mkt ?asset (Suc 0) ?w / prices ?Mkt ?asset 0 ?w * (val_process ?Mkt (self_finance ?Mkt ?v ?pf ?asset) 0 ?w - val_process ?Mkt ?pf 0 ?w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
hence "\<exists>m. n = Suc m"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. \<exists>m. n = Suc m
[PROOF STEP]
by (simp add: not0_implies_Suc)
[PROOF STATE]
proof (state)
this:
\<exists>m. n = Suc m

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>m. n = Suc m
[PROOF STEP]
obtain m where "n = Suc m"
[PROOF STATE]
proof (prove)
using this:
\<exists>m. n = Suc m

goal (1 subgoal):
 1. (\<And>m. n = Suc m \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n = Suc m

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
hence "cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w =
    cls_val_process Mkt (self_finance Mkt v pf asset) (Suc (Suc m)) w"
[PROOF STATE]
proof (prove)
using this:
n = Suc m

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt (self_finance Mkt v pf asset) (Suc (Suc m)) w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt (self_finance Mkt v pf asset) (Suc (Suc m)) w

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt (self_finance Mkt v pf asset) (Suc (Suc m)) w

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
have "...  = cls_val_process Mkt pf (Suc (Suc m)) w +
    (prices Mkt asset (Suc (Suc m)) w / (prices Mkt asset (Suc m) w)) *
      (cls_val_process Mkt (self_finance Mkt v pf asset) (Suc m) w -
     val_process Mkt pf (Suc m) w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc (Suc m)) w = cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (cls_val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w)
[PROOF STEP]
using assms self_finance_updated_suc_suc[of pf]
[PROOF STATE]
proof (prove)
using this:
portfolio pf
\<forall>n w. prices Mkt asset n w \<noteq> 0
\<lbrakk>portfolio pf; \<forall>n. prices ?Mkt ?asset n ?w \<noteq> 0\<rbrakk> \<Longrightarrow> cls_val_process ?Mkt (self_finance ?Mkt ?v pf ?asset) (Suc (Suc ?n)) ?w = cls_val_process ?Mkt pf (Suc (Suc ?n)) ?w + prices ?Mkt ?asset (Suc (Suc ?n)) ?w / prices ?Mkt ?asset (Suc ?n) ?w * (cls_val_process ?Mkt (self_finance ?Mkt ?v pf ?asset) (Suc ?n) ?w - val_process ?Mkt pf (Suc ?n) ?w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc (Suc m)) w = cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (cls_val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc (Suc m)) w = cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (cls_val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc (Suc m)) w = cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (cls_val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
have "... = cls_val_process Mkt pf (Suc (Suc m)) w +
    (prices Mkt asset (Suc (Suc m)) w / (prices Mkt asset (Suc m) w)) *
      (val_process Mkt (self_finance Mkt v pf asset) (Suc m) w -
     val_process Mkt pf (Suc m) w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (cls_val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w) = cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w)
[PROOF STEP]
using assms self_finance_charact
[PROOF STATE]
proof (prove)
using this:
portfolio pf
\<forall>n w. prices Mkt asset n w \<noteq> 0
\<lbrakk>\<forall>n w. prices ?Mkt ?asset (Suc n) w \<noteq> 0; portfolio ?pf\<rbrakk> \<Longrightarrow> self_financing ?Mkt (self_finance ?Mkt ?v ?pf ?asset)

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (cls_val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w) = cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w)
[PROOF STEP]
unfolding self_financing_def
[PROOF STATE]
proof (prove)
using this:
portfolio pf
\<forall>n w. prices Mkt asset n w \<noteq> 0
\<lbrakk>\<forall>n w. prices ?Mkt ?asset (Suc n) w \<noteq> 0; portfolio ?pf\<rbrakk> \<Longrightarrow> \<forall>n. val_process ?Mkt (self_finance ?Mkt ?v ?pf ?asset) (Suc n) = cls_val_process ?Mkt (self_finance ?Mkt ?v ?pf ?asset) (Suc n)

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (cls_val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w) = cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w)
[PROOF STEP]
by (simp add: self_finance_succ self_finance_updated)
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (cls_val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w) = cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (cls_val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w) = cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
have "... = cls_val_process Mkt pf (Suc n) w +
    (prices Mkt asset (Suc n) w / (prices Mkt asset n w)) *
      (val_process Mkt (self_finance Mkt v pf asset) n w -
     val_process Mkt pf n w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w) = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
using \<open>n = Suc m\<close>
[PROOF STATE]
proof (prove)
using this:
n = Suc m

goal (1 subgoal):
 1. cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w) = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf (Suc (Suc m)) w + prices Mkt asset (Suc (Suc m)) w / prices Mkt asset (Suc m) w * (val_process Mkt (self_finance Mkt v pf asset) (Suc m) w - val_process Mkt pf (Suc m) w) = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)

goal (1 subgoal):
 1. cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt (self_finance Mkt v pf asset) (Suc n) w = cls_val_process Mkt pf (Suc n) w + prices Mkt asset (Suc n) w / prices Mkt asset n w * (val_process Mkt (self_finance Mkt v pf asset) n w - val_process Mkt pf n w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma numeral_le_ennreal_iff [simp]: "numeral n \<le> ennreal m \<longleftrightarrow> numeral n \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral n \<le> ennreal m) = (numeral n \<le> m)
[PROOF STEP]
by (metis not_le ennreal_less_numeral_iff)


[STATEMENT]
lemma integral_has_vector_derivative:
  fixes f :: "real \<Rightarrow> 'a::banach"
  assumes "continuous_on {a..b} f"
    and "x \<in> {a..b}"
  shows "((\<lambda>u. integral {a..u} f) has_vector_derivative f(x)) (at x within {a..b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b})
[PROOF STEP]
using assms integral_has_vector_derivative_continuous_at [OF integrable_continuous_real]
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} f
x \<in> {a..b}
\<lbrakk>continuous_on {?a..?b} ?f; ?x \<in> {?a..?b} - ?S; finite ?S; continuous (at ?x within {?a..?b} - ?S) ?f\<rbrakk> \<Longrightarrow> ((\<lambda>u. integral {?a..u} ?f) has_vector_derivative ?f ?x) (at ?x within {?a..?b} - ?S)

goal (1 subgoal):
 1. ((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b})
[PROOF STEP]
by (fastforce simp: continuous_on_eq_continuous_within)


[STATEMENT]
lemma natfun_inverse_bound:
  fixes f :: "'a :: {real_normed_field} fps"
  assumes "fps_nth f 0 = 1" and "\<delta> > 0"
      and summable: "summable (\<lambda>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n)"
      and le: "(\<Sum>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n) \<le> 1"
  shows   "norm (natfun_inverse f n) \<le> inverse (\<delta> ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (natfun_inverse f n) \<le> inverse (\<delta> ^ n)
[PROOF STEP]
proof (induction n rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> norm (natfun_inverse f y) \<le> inverse (\<delta> ^ y)) \<Longrightarrow> norm (natfun_inverse f x) \<le> inverse (\<delta> ^ x)
[PROOF STEP]
case (less m)
[PROOF STATE]
proof (state)
this:
?y < m \<Longrightarrow> norm (natfun_inverse f ?y) \<le> inverse (\<delta> ^ ?y)

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> norm (natfun_inverse f y) \<le> inverse (\<delta> ^ y)) \<Longrightarrow> norm (natfun_inverse f x) \<le> inverse (\<delta> ^ x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
proof (cases m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = 0 \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
 2. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
m = 0

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
 2. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
m = 0

goal (1 subgoal):
 1. norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m = 0
fps_nth f 0 = (1::'a)
0 < \<delta>
summable (\<lambda>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n)
(\<Sum>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n) \<le> 1

goal (1 subgoal):
 1. norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
by (simp add: field_split_simps norm_inverse norm_divide)
[PROOF STATE]
proof (state)
this:
norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
case [simp]: (Suc n)
[PROOF STATE]
proof (state)
this:
m = Suc n

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
have "norm (natfun_inverse f (Suc n)) =
            norm (\<Sum>i = Suc 0..Suc n. fps_nth f i * natfun_inverse f (Suc n - i))"
      (is "_ = norm ?S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (natfun_inverse f (Suc n)) = norm (\<Sum>i = Suc 0..Suc n. fps_nth f i * natfun_inverse f (Suc n - i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fps_nth f 0 = (1::'a)
0 < \<delta>
summable (\<lambda>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n)
(\<Sum>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n) \<le> 1

goal (1 subgoal):
 1. norm (natfun_inverse f (Suc n)) = norm (\<Sum>i = Suc 0..Suc n. fps_nth f i * natfun_inverse f (Suc n - i))
[PROOF STEP]
by (simp add: field_simps norm_mult norm_divide del: sum.cl_ivl_Suc)
[PROOF STATE]
proof (state)
this:
norm (natfun_inverse f (Suc n)) = norm (\<Sum>i = Suc 0..Suc n. fps_nth f i * natfun_inverse f (Suc n - i))

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (natfun_inverse f (Suc n)) = norm (\<Sum>i = Suc 0..Suc n. fps_nth f i * natfun_inverse f (Suc n - i))

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
have "norm ?S \<le> (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i * natfun_inverse f (Suc n - i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>i = Suc 0..Suc n. fps_nth f i * natfun_inverse f (Suc n - i)) \<le> (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i * natfun_inverse f (Suc n - i)))
[PROOF STEP]
by (rule norm_sum)
[PROOF STATE]
proof (state)
this:
norm (\<Sum>i = Suc 0..Suc n. fps_nth f i * natfun_inverse f (Suc n - i)) \<le> (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i * natfun_inverse f (Suc n - i)))

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (\<Sum>i = Suc 0..Suc n. fps_nth f i * natfun_inverse f (Suc n - i)) \<le> (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i * natfun_inverse f (Suc n - i)))

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
have "\<dots> \<le> (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) / \<delta> ^ (Suc n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i * natfun_inverse f (Suc n - i))) \<le> (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) / \<delta> ^ (Suc n - i))
[PROOF STEP]
proof (intro sum_mono, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {Suc 0..Suc n} \<Longrightarrow> norm (fps_nth f i * natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) / \<delta> ^ (Suc n - i)
[PROOF STEP]
case (1 i)
[PROOF STATE]
proof (state)
this:
i \<in> {Suc 0..Suc n}

goal (1 subgoal):
 1. \<And>i. i \<in> {Suc 0..Suc n} \<Longrightarrow> norm (fps_nth f i * natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) / \<delta> ^ (Suc n - i)
[PROOF STEP]
have "norm (fps_nth f i * natfun_inverse f (Suc n - i)) =
              norm (fps_nth f i) * norm (natfun_inverse f (Suc n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (fps_nth f i * natfun_inverse f (Suc n - i)) = norm (fps_nth f i) * norm (natfun_inverse f (Suc n - i))
[PROOF STEP]
by (simp add: norm_mult)
[PROOF STATE]
proof (state)
this:
norm (fps_nth f i * natfun_inverse f (Suc n - i)) = norm (fps_nth f i) * norm (natfun_inverse f (Suc n - i))

goal (1 subgoal):
 1. \<And>i. i \<in> {Suc 0..Suc n} \<Longrightarrow> norm (fps_nth f i * natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) / \<delta> ^ (Suc n - i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (fps_nth f i * natfun_inverse f (Suc n - i)) = norm (fps_nth f i) * norm (natfun_inverse f (Suc n - i))

goal (1 subgoal):
 1. \<And>i. i \<in> {Suc 0..Suc n} \<Longrightarrow> norm (fps_nth f i * natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) / \<delta> ^ (Suc n - i)
[PROOF STEP]
have "\<dots> \<le> norm (fps_nth f i) * inverse (\<delta> ^ (Suc n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (fps_nth f i) * norm (natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) * inverse (\<delta> ^ (Suc n - i))
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
i \<in> {Suc 0..Suc n}

goal (1 subgoal):
 1. norm (fps_nth f i) * norm (natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) * inverse (\<delta> ^ (Suc n - i))
[PROOF STEP]
by (intro mult_left_mono less.IH) auto
[PROOF STATE]
proof (state)
this:
norm (fps_nth f i) * norm (natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) * inverse (\<delta> ^ (Suc n - i))

goal (1 subgoal):
 1. \<And>i. i \<in> {Suc 0..Suc n} \<Longrightarrow> norm (fps_nth f i * natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) / \<delta> ^ (Suc n - i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (fps_nth f i) * norm (natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) * inverse (\<delta> ^ (Suc n - i))

goal (1 subgoal):
 1. \<And>i. i \<in> {Suc 0..Suc n} \<Longrightarrow> norm (fps_nth f i * natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) / \<delta> ^ (Suc n - i)
[PROOF STEP]
have "\<dots> = norm (fps_nth f i) / \<delta> ^ (Suc n - i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (fps_nth f i) * inverse (\<delta> ^ (Suc n - i)) = norm (fps_nth f i) / \<delta> ^ (Suc n - i)
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
norm (fps_nth f i) * inverse (\<delta> ^ (Suc n - i)) = norm (fps_nth f i) / \<delta> ^ (Suc n - i)

goal (1 subgoal):
 1. \<And>i. i \<in> {Suc 0..Suc n} \<Longrightarrow> norm (fps_nth f i * natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) / \<delta> ^ (Suc n - i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (fps_nth f i * natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) / \<delta> ^ (Suc n - i)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
norm (fps_nth f i * natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) / \<delta> ^ (Suc n - i)

goal (1 subgoal):
 1. norm (fps_nth f i * natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) / \<delta> ^ (Suc n - i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (fps_nth f i * natfun_inverse f (Suc n - i)) \<le> norm (fps_nth f i) / \<delta> ^ (Suc n - i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i = Suc 0..Suc n. norm (fps_nth f i * natfun_inverse f (Suc n - i))) \<le> (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) / \<delta> ^ (Suc n - i))

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = Suc 0..Suc n. norm (fps_nth f i * natfun_inverse f (Suc n - i))) \<le> (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) / \<delta> ^ (Suc n - i))

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
have "\<dots> = (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) * \<delta> ^ i) / \<delta> ^ Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) / \<delta> ^ (Suc n - i)) = (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) * \<delta> ^ i) / \<delta> ^ Suc n
[PROOF STEP]
by (subst sum_divide_distrib, rule sum.cong)
         (insert \<open>\<delta> > 0\<close>, auto simp: field_simps power_diff)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) / \<delta> ^ (Suc n - i)) = (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) * \<delta> ^ i) / \<delta> ^ Suc n

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) / \<delta> ^ (Suc n - i)) = (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) * \<delta> ^ i) / \<delta> ^ Suc n

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
have "(\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) * \<delta> ^ i) =
                 (\<Sum>i=0..n. norm (fps_nth f (Suc i)) * \<delta> ^ (Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) * \<delta> ^ i) = (\<Sum>i = 0..n. norm (fps_nth f (Suc i)) * \<delta> ^ Suc i)
[PROOF STEP]
by (subst sum.atLeast_Suc_atMost_Suc_shift) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) * \<delta> ^ i) = (\<Sum>i = 0..n. norm (fps_nth f (Suc i)) * \<delta> ^ Suc i)

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = Suc 0..Suc n. norm (fps_nth f i) * \<delta> ^ i) = (\<Sum>i = 0..n. norm (fps_nth f (Suc i)) * \<delta> ^ Suc i)

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
have "{0..n} = {..<Suc n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..n} = {..<Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..n} = {..<Suc n}

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{0..n} = {..<Suc n}

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
have "(\<Sum>i< Suc n. norm (fps_nth f (Suc i)) * \<delta> ^ (Suc i)) \<le>
                 (\<Sum>n. norm (fps_nth f (Suc n)) * \<delta> ^ (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<Suc n. norm (fps_nth f (Suc i)) * \<delta> ^ Suc i) \<le> (\<Sum>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n)
[PROOF STEP]
using \<open>\<delta> > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < \<delta>

goal (1 subgoal):
 1. (\<Sum>i<Suc n. norm (fps_nth f (Suc i)) * \<delta> ^ Suc i) \<le> (\<Sum>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n)
[PROOF STEP]
by (intro sum_le_suminf ballI mult_nonneg_nonneg zero_le_power summable) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<Suc n. norm (fps_nth f (Suc i)) * \<delta> ^ Suc i) \<le> (\<Sum>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n)

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<Suc n. norm (fps_nth f (Suc i)) * \<delta> ^ Suc i) \<le> (\<Sum>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n)

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
have "\<dots> \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n) \<le> 1
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
(\<Sum>n. norm (fps_nth f (Suc n)) * \<delta> ^ Suc n) \<le> 1

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x / \<delta> ^ Suc n \<le> y / \<delta> ^ Suc n; \<And>x y. x \<le> y \<Longrightarrow> x / \<delta> ^ Suc n \<le> y / \<delta> ^ Suc n\<rbrakk> \<Longrightarrow> norm (natfun_inverse f (Suc n)) \<le> 1 / \<delta> ^ Suc n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x / \<delta> ^ Suc n \<le> y / \<delta> ^ Suc n; \<And>x y. x \<le> y \<Longrightarrow> x / \<delta> ^ Suc n \<le> y / \<delta> ^ Suc n\<rbrakk> \<Longrightarrow> norm (natfun_inverse f (Suc n)) \<le> 1 / \<delta> ^ Suc n

goal (1 subgoal):
 1. norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
using \<open>\<delta> > 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x / \<delta> ^ Suc n \<le> y / \<delta> ^ Suc n; \<And>x y. x \<le> y \<Longrightarrow> x / \<delta> ^ Suc n \<le> y / \<delta> ^ Suc n\<rbrakk> \<Longrightarrow> norm (natfun_inverse f (Suc n)) \<le> 1 / \<delta> ^ Suc n
0 < \<delta>

goal (1 subgoal):
 1. norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)
[PROOF STEP]
by (simp add: divide_right_mono field_split_simps)
[PROOF STATE]
proof (state)
this:
norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
norm (natfun_inverse f m) \<le> inverse (\<delta> ^ m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invertible_bezout_matrix:
  fixes A::"'a::{bezout_ring_div}^'cols^'rows::{finite,wellorder}"
  assumes ib: "is_bezout_ext bezout"
  and a_less_b: "a < b"
  and aj: "A $ a $ j \<noteq> 0"
  shows "invertible (bezout_matrix A a b j bezout)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (bezout_matrix A a b j bezout)
[PROOF STEP]
unfolding invertible_iff_is_unit
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit (det (bezout_matrix A a b j bezout))
[PROOF STEP]
unfolding det_bezout_matrix[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit (1::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma table_fvi_tl: "table (Suc n) (MFOTL.fvi b \<phi>) X \<Longrightarrow> table n (MFOTL.fvi (Suc b) \<phi>) (tl ` X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. table (Suc n) (MFOTL.fvi b \<phi>) X \<Longrightarrow> table n (MFOTL.fvi (Suc b) \<phi>) (tl ` X)
[PROOF STEP]
unfolding table_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball X (wf_tuple (Suc n) (MFOTL.fvi b \<phi>)) \<Longrightarrow> Ball (tl ` X) (wf_tuple n (MFOTL.fvi (Suc b) \<phi>))
[PROOF STEP]
by (auto intro: wf_tuple_Suc_fviD)


[STATEMENT]
lemma closed_Union_compact_subsets:
  fixes S :: "'a::{heine_borel,real_normed_vector} set"
  assumes "closed S"
  obtains F where "\<And>n. compact(F n)" "\<And>n. F n \<subseteq> S" "\<And>n. F n \<subseteq> F(Suc n)"
                  "(\<Union>n. F n) = S" "\<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n \<ge> N. K \<subseteq> F n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> compact (?F2 n)
 2. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?F2 n \<subseteq> S
 3. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?F2 n \<subseteq> ?F2 (Suc n)
 4. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> \<Union> (range ?F2) = S
 5. \<And>K. \<lbrakk>\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis; compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> ?F2 n
[PROOF STEP]
show "compact (S \<inter> cball 0 (of_nat n))" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (S \<inter> cball (0::'a) (real n))
[PROOF STEP]
using assms compact_eq_bounded_closed
[PROOF STATE]
proof (prove)
using this:
closed S
compact ?S = (bounded ?S \<and> closed ?S)

goal (1 subgoal):
 1. compact (S \<inter> cball (0::'a) (real n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
compact (S \<inter> cball (0::'a) (real ?n))

goal (4 subgoals):
 1. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real (?n11 n)) \<subseteq> S
 2. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real (?n11 n)) \<subseteq> S \<inter> cball (0::'a) (real (?n11 (Suc n)))
 3. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> (\<Union>n. S \<inter> cball (0::'a) (real (?n11 n))) = S
 4. \<And>K. \<lbrakk>\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis; compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> S \<inter> cball (0::'a) (real (?n11 n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real (?n11 n)) \<subseteq> S
 2. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real (?n11 n)) \<subseteq> S \<inter> cball (0::'a) (real (?n11 (Suc n)))
 3. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> (\<Union>n. S \<inter> cball (0::'a) (real (?n11 n))) = S
 4. \<And>K. \<lbrakk>\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis; compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> S \<inter> cball (0::'a) (real (?n11 n))
[PROOF STEP]
show "(\<Union>n. S \<inter> cball 0 (real n)) = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n. S \<inter> cball (0::'a) (real n)) = S
[PROOF STEP]
by (auto simp: real_arch_simple)
[PROOF STATE]
proof (state)
this:
(\<Union>n. S \<inter> cball (0::'a) (real n)) = S

goal (3 subgoals):
 1. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S
 2. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S \<inter> cball (0::'a) (real (Suc n))
 3. \<And>K. \<lbrakk>\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis; compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> S \<inter> cball (0::'a) (real n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S
 2. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S \<inter> cball (0::'a) (real (Suc n))
 3. \<And>K. \<lbrakk>\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis; compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> S \<inter> cball (0::'a) (real n)
[PROOF STEP]
fix K :: "'a set"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S
 2. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S \<inter> cball (0::'a) (real (Suc n))
 3. \<And>K. \<lbrakk>\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis; compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> S \<inter> cball (0::'a) (real n)
[PROOF STEP]
assume "compact K" "K \<subseteq> S"
[PROOF STATE]
proof (state)
this:
compact K
K \<subseteq> S

goal (3 subgoals):
 1. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S
 2. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S \<inter> cball (0::'a) (real (Suc n))
 3. \<And>K. \<lbrakk>\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis; compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> S \<inter> cball (0::'a) (real n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
compact K
K \<subseteq> S
[PROOF STEP]
obtain N where "K \<subseteq> cball 0 N"
[PROOF STATE]
proof (prove)
using this:
compact K
K \<subseteq> S

goal (1 subgoal):
 1. (\<And>N. K \<subseteq> cball (0::'a) N \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson bounded_pos mem_cball_0 compact_imp_bounded subsetI)
[PROOF STATE]
proof (state)
this:
K \<subseteq> cball (0::'a) N

goal (3 subgoals):
 1. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S
 2. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S \<inter> cball (0::'a) (real (Suc n))
 3. \<And>K. \<lbrakk>\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis; compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> S \<inter> cball (0::'a) (real n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K \<subseteq> cball (0::'a) N
[PROOF STEP]
show "\<exists>N. \<forall>n\<ge>N. K \<subseteq> S \<inter> cball 0 (real n)"
[PROOF STATE]
proof (prove)
using this:
K \<subseteq> cball (0::'a) N

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. K \<subseteq> S \<inter> cball (0::'a) (real n)
[PROOF STEP]
by (metis of_nat_le_iff Int_subset_iff \<open>K \<subseteq> S\<close> real_arch_simple subset_cball subset_trans)
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. K \<subseteq> S \<inter> cball (0::'a) (real n)

goal (2 subgoals):
 1. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S
 2. \<And>n. (\<And>F. \<lbrakk>\<And>n. compact (F n); \<And>n. F n \<subseteq> S; \<And>n. F n \<subseteq> F (Suc n); \<Union> (range F) = S; \<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> F n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<inter> cball (0::'a) (real n) \<subseteq> S \<inter> cball (0::'a) (real (Suc n))
[PROOF STEP]
qed auto


[STATEMENT]
lemma contour_integrable_sum:
    "\<lbrakk>finite s; \<And>a. a \<in> s \<Longrightarrow> (f a) contour_integrable_on p\<rbrakk>
     \<Longrightarrow> (\<lambda>x. sum (\<lambda>a. f a x) s) contour_integrable_on p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite s; \<And>a. a \<in> s \<Longrightarrow> f a contour_integrable_on p\<rbrakk> \<Longrightarrow> (\<lambda>x. \<Sum>a\<in>s. f a x) contour_integrable_on p
[PROOF STEP]
unfolding contour_integrable_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite s; \<And>a. a \<in> s \<Longrightarrow> \<exists>i. (f a has_contour_integral i) p\<rbrakk> \<Longrightarrow> \<exists>i. ((\<lambda>x. \<Sum>a\<in>s. f a x) has_contour_integral i) p
[PROOF STEP]
by (metis has_contour_integral_sum)


[STATEMENT]
lemma atLeastLessThan_injective2:
"bij_betw f {0 ..< m::nat} {0 ..< n} \<Longrightarrow> m = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw f {0..<m} {0..<n} \<Longrightarrow> m = n
[PROOF STEP]
using finite_atLeastLessThan[of m] finite_atLeastLessThan[of n]
      card_atLeastLessThan[of m] card_atLeastLessThan[of n]
      bij_betw_iff_card[of "{0 ..< m}" "{0 ..< n}"]
[PROOF STATE]
proof (prove)
using this:
finite {m..<?u}
finite {n..<?u}
card {m..<?u} = ?u - m
card {n..<?u} = ?u - n
\<lbrakk>finite {0..<m}; finite {0..<n}\<rbrakk> \<Longrightarrow> (\<exists>f. bij_betw f {0..<m} {0..<n}) = (card {0..<m} = card {0..<n})

goal (1 subgoal):
 1. bij_betw f {0..<m} {0..<n} \<Longrightarrow> m = n
[PROOF STEP]
by auto


[STATEMENT]
lemma nats_of_boolss_append:
  "list_all (is_alph n) bss \<Longrightarrow> list_all (is_alph n) bss' \<Longrightarrow>
     nats_of_boolss n (bss @ bss') =
     map (\<lambda>(x, y). x + 2 ^ length bss * y) (zip (nats_of_boolss n bss) (nats_of_boolss n bss'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all (is_alph n) bss; list_all (is_alph n) bss'\<rbrakk> \<Longrightarrow> nats_of_boolss n (bss @ bss') = map2 (\<lambda>x y. x + 2 ^ length bss * y) (nats_of_boolss n bss) (nats_of_boolss n bss')
[PROOF STEP]
by (induct bss)
    (auto simp add: nats_of_boolss_length zip_replicate_map o_def
     map_zip_map map_zip_map2 zip_assoc is_alph_def)


[STATEMENT]
lemma at_within_altdef:
  "at x within A = (INF S\<in>{S. open S \<and> x \<in> S}. principal (S \<inter> (A - {x})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within A = (INF S\<in>{S. open S \<and> x \<in> S}. principal (S \<inter> (A - {x})))
[PROOF STEP]
unfolding at_within_def nhds_def inf_principal [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf (Inf (principal ` {S. open S \<and> x \<in> S})) (principal (A - {x})) = (INF S\<in>{S. open S \<and> x \<in> S}. inf (principal S) (principal (A - {x})))
[PROOF STEP]
by (subst INF_inf_distrib [symmetric]) (auto simp: INF_constant)