[STATEMENT]
lemma not_essential_inverse[singularity_intros]:
  assumes f_ness:"not_essential f z"
  assumes f_iso:"isolated_singularity_at f z"
  shows "not_essential (\<lambda>w. inverse (f w)) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
define vf where "vf = (\<lambda>w. inverse (f w))"
[PROOF STATE]
proof (state)
this:
vf = (\<lambda>w. inverse (f w))

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
have ?thesis when "\<not>(\<exists>\<^sub>Fw in (at z). f w\<noteq>0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
have "\<forall>\<^sub>Fw in (at z). f w=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. f w = 0
[PROOF STEP]
using that[unfolded frequently_def, simplified]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at z. f x = 0

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. f w = 0
[PROOF STEP]
by (auto elim: eventually_rev_mp)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F w in at z. f w = 0

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F w in at z. f w = 0
[PROOF STEP]
have "\<forall>\<^sub>Fw in (at z). vf w=0"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F w in at z. f w = 0

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. vf w = 0
[PROOF STEP]
unfolding vf_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F w in at z. f w = 0

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. inverse (f w) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F w in at z. vf w = 0

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
from tendsto_cong[OF this]
[PROOF STATE]
proof (chain)
picking this:
vf \<midarrow>z\<rightarrow> ?c = (\<lambda>w. 0) \<midarrow>z\<rightarrow> ?c
[PROOF STEP]
have "vf \<midarrow>z\<rightarrow>0"
[PROOF STATE]
proof (prove)
using this:
vf \<midarrow>z\<rightarrow> ?c = (\<lambda>w. 0) \<midarrow>z\<rightarrow> ?c

goal (1 subgoal):
 1. vf \<midarrow>z\<rightarrow> 0
[PROOF STEP]
unfolding vf_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> ?c = (\<lambda>w. 0) \<midarrow>z\<rightarrow> ?c

goal (1 subgoal):
 1. (\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vf \<midarrow>z\<rightarrow> 0

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vf \<midarrow>z\<rightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vf \<midarrow>z\<rightarrow> 0

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
unfolding not_essential_def vf_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> 0

goal (1 subgoal):
 1. \<exists>x. (\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> x \<or> is_pole (\<lambda>w. inverse (f w)) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_essential (\<lambda>w. inverse (f w)) z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>\<^sub>F w in at z. f w \<noteq> 0) \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>\<^sub>F w in at z. f w \<noteq> 0) \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
have ?thesis when "is_pole f z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
have "vf \<midarrow>z\<rightarrow>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vf \<midarrow>z\<rightarrow> 0
[PROOF STEP]
using that filterlim_at filterlim_inverse_at_iff
[PROOF STATE]
proof (prove)
using this:
is_pole f z
filterlim ?f (at ?b within ?s) ?F = ((\<forall>\<^sub>F x in ?F. ?f x \<in> ?s \<and> ?f x \<noteq> ?b) \<and> (?f \<longlongrightarrow> ?b) ?F)
(LIM x ?F. inverse (?g x) :> at (0::?'b)) = filterlim ?g at_infinity ?F

goal (1 subgoal):
 1. vf \<midarrow>z\<rightarrow> 0
[PROOF STEP]
unfolding is_pole_def vf_def
[PROOF STATE]
proof (prove)
using this:
filterlim f at_infinity (at z)
filterlim ?f (at ?b within ?s) ?F = ((\<forall>\<^sub>F x in ?F. ?f x \<in> ?s \<and> ?f x \<noteq> ?b) \<and> (?f \<longlongrightarrow> ?b) ?F)
(LIM x ?F. inverse (?g x) :> at (0::?'b)) = filterlim ?g at_infinity ?F

goal (1 subgoal):
 1. (\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vf \<midarrow>z\<rightarrow> 0

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vf \<midarrow>z\<rightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vf \<midarrow>z\<rightarrow> 0

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
unfolding not_essential_def vf_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> 0

goal (1 subgoal):
 1. \<exists>x. (\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> x \<or> is_pole (\<lambda>w. inverse (f w)) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_essential (\<lambda>w. inverse (f w)) z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_pole f z \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
is_pole f z \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
have ?thesis when "\<exists>x. f\<midarrow>z\<rightarrow>x " and f_nconst:"\<exists>\<^sub>Fw in (at z). f w\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. f \<midarrow>z\<rightarrow> x
\<exists>\<^sub>F w in at z. f w \<noteq> 0
[PROOF STEP]
obtain fz where fz:"f\<midarrow>z\<rightarrow>fz"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. f \<midarrow>z\<rightarrow> x
\<exists>\<^sub>F w in at z. f w \<noteq> 0

goal (1 subgoal):
 1. (\<And>fz. f \<midarrow>z\<rightarrow> fz \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<midarrow>z\<rightarrow> fz

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
have ?thesis when "fz=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
have "(\<lambda>w. inverse (vf w)) \<midarrow>z\<rightarrow>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. inverse (vf w)) \<midarrow>z\<rightarrow> 0
[PROOF STEP]
using fz that
[PROOF STATE]
proof (prove)
using this:
f \<midarrow>z\<rightarrow> fz
fz = 0

goal (1 subgoal):
 1. (\<lambda>w. inverse (vf w)) \<midarrow>z\<rightarrow> 0
[PROOF STEP]
unfolding vf_def
[PROOF STATE]
proof (prove)
using this:
f \<midarrow>z\<rightarrow> fz
fz = 0

goal (1 subgoal):
 1. (\<lambda>w. inverse (inverse (f w))) \<midarrow>z\<rightarrow> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>w. inverse (vf w)) \<midarrow>z\<rightarrow> 0

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>w. inverse (vf w)) \<midarrow>z\<rightarrow> 0

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
have "\<forall>\<^sub>F w in at z. inverse (vf w) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. inverse (vf w) \<noteq> 0
[PROOF STEP]
using non_zero_neighbour[OF f_iso f_ness f_nconst]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F w in at z. f w \<noteq> 0

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. inverse (vf w) \<noteq> 0
[PROOF STEP]
unfolding vf_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F w in at z. f w \<noteq> 0

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. inverse (inverse (f w)) \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F w in at z. inverse (vf w) \<noteq> 0

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>w. inverse (vf w)) \<midarrow>z\<rightarrow> 0
\<forall>\<^sub>F w in at z. inverse (vf w) \<noteq> 0
[PROOF STEP]
have "is_pole vf z"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. inverse (vf w)) \<midarrow>z\<rightarrow> 0
\<forall>\<^sub>F w in at z. inverse (vf w) \<noteq> 0

goal (1 subgoal):
 1. is_pole vf z
[PROOF STEP]
using filterlim_inverse_at_iff[of vf "at z"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. inverse (vf w)) \<midarrow>z\<rightarrow> 0
\<forall>\<^sub>F w in at z. inverse (vf w) \<noteq> 0
(LIM x at z. inverse (vf x) :> at 0) = filterlim vf at_infinity (at z)

goal (1 subgoal):
 1. is_pole vf z
[PROOF STEP]
unfolding filterlim_at is_pole_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. inverse (vf w)) \<midarrow>z\<rightarrow> 0
\<forall>\<^sub>F w in at z. inverse (vf w) \<noteq> 0
((\<forall>\<^sub>F x in at z. inverse (vf x) \<in> UNIV \<and> inverse (vf x) \<noteq> 0) \<and> (\<lambda>x. inverse (vf x)) \<midarrow>z\<rightarrow> 0) = filterlim vf at_infinity (at z)

goal (1 subgoal):
 1. filterlim vf at_infinity (at z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_pole vf z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_pole vf z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_pole vf z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
unfolding not_essential_def vf_def
[PROOF STATE]
proof (prove)
using this:
is_pole (\<lambda>w. inverse (f w)) z

goal (1 subgoal):
 1. \<exists>x. (\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> x \<or> is_pole (\<lambda>w. inverse (f w)) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_essential (\<lambda>w. inverse (f w)) z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fz = 0 \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fz = 0 \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
have ?thesis when "fz\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
have "vf \<midarrow>z\<rightarrow>inverse fz"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vf \<midarrow>z\<rightarrow> inverse fz
[PROOF STEP]
using fz that
[PROOF STATE]
proof (prove)
using this:
f \<midarrow>z\<rightarrow> fz
fz \<noteq> 0

goal (1 subgoal):
 1. vf \<midarrow>z\<rightarrow> inverse fz
[PROOF STEP]
unfolding vf_def
[PROOF STATE]
proof (prove)
using this:
f \<midarrow>z\<rightarrow> fz
fz \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> inverse fz
[PROOF STEP]
by (auto intro:tendsto_eq_intros)
[PROOF STATE]
proof (state)
this:
vf \<midarrow>z\<rightarrow> inverse fz

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vf \<midarrow>z\<rightarrow> inverse fz
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vf \<midarrow>z\<rightarrow> inverse fz

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
unfolding not_essential_def vf_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> inverse fz

goal (1 subgoal):
 1. \<exists>x. (\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> x \<or> is_pole (\<lambda>w. inverse (f w)) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_essential (\<lambda>w. inverse (f w)) z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fz \<noteq> 0 \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fz = 0 \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z
fz \<noteq> 0 \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fz = 0 \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z
fz \<noteq> 0 \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_essential (\<lambda>w. inverse (f w)) z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<exists>x. f \<midarrow>z\<rightarrow> x; \<exists>\<^sub>F w in at z. f w \<noteq> 0\<rbrakk> \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>\<^sub>F w in at z. f w \<noteq> 0) \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z
is_pole f z \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z
\<lbrakk>\<exists>x. f \<midarrow>z\<rightarrow> x; \<exists>\<^sub>F w in at z. f w \<noteq> 0\<rbrakk> \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>\<^sub>F w in at z. f w \<noteq> 0) \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z
is_pole f z \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z
\<lbrakk>\<exists>x. f \<midarrow>z\<rightarrow> x; \<exists>\<^sub>F w in at z. f w \<noteq> 0\<rbrakk> \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
using f_ness
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>\<^sub>F w in at z. f w \<noteq> 0) \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z
is_pole f z \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z
\<lbrakk>\<exists>x. f \<midarrow>z\<rightarrow> x; \<exists>\<^sub>F w in at z. f w \<noteq> 0\<rbrakk> \<Longrightarrow> not_essential (\<lambda>w. inverse (f w)) z
not_essential f z

goal (1 subgoal):
 1. not_essential (\<lambda>w. inverse (f w)) z
[PROOF STEP]
unfolding not_essential_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>\<^sub>F w in at z. f w \<noteq> 0) \<Longrightarrow> \<exists>x. (\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> x \<or> is_pole (\<lambda>w. inverse (f w)) z
is_pole f z \<Longrightarrow> \<exists>x. (\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> x \<or> is_pole (\<lambda>w. inverse (f w)) z
\<lbrakk>\<exists>x. f \<midarrow>z\<rightarrow> x; \<exists>\<^sub>F w in at z. f w \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>x. (\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> x \<or> is_pole (\<lambda>w. inverse (f w)) z
\<exists>x. f \<midarrow>z\<rightarrow> x \<or> is_pole f z

goal (1 subgoal):
 1. \<exists>x. (\<lambda>w. inverse (f w)) \<midarrow>z\<rightarrow> x \<or> is_pole (\<lambda>w. inverse (f w)) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_essential (\<lambda>w. inverse (f w)) z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_add: "summable f \<Longrightarrow> summable g \<Longrightarrow> suminf f + suminf g = (\<Sum>n. f n + g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>summable f; summable g\<rbrakk> \<Longrightarrow> suminf f + suminf g = (\<Sum>n. f n + g n)
[PROOF STEP]
by (intro sums_unique sums_add summable_sums)


[STATEMENT]
lemma bigo_lesseq3: "f =o O(h) \<Longrightarrow> \<forall>x. 0 \<le> g x \<Longrightarrow> \<forall>x. g x \<le> f x \<Longrightarrow> g =o O(h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> O(h); \<forall>x. (0::'b) \<le> g x; \<forall>x. g x \<le> f x\<rbrakk> \<Longrightarrow> g \<in> O(h)
[PROOF STEP]
apply (erule bigo_lesseq2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> g x; \<forall>x. g x \<le> f x\<rbrakk> \<Longrightarrow> \<forall>x. \<bar>g x\<bar> \<le> f x
[PROOF STEP]
apply (rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x. (0::'b) \<le> g x; \<forall>x. g x \<le> f x\<rbrakk> \<Longrightarrow> \<bar>g x\<bar> \<le> f x
[PROOF STEP]
apply (subst abs_of_nonneg)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x. (0::'b) \<le> g x; \<forall>x. g x \<le> f x\<rbrakk> \<Longrightarrow> (0::'b) \<le> g x
 2. \<And>x. \<lbrakk>\<forall>x. (0::'b) \<le> g x; \<forall>x. g x \<le> f x\<rbrakk> \<Longrightarrow> g x \<le> f x
[PROOF STEP]
apply (erule spec)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma trap_arithmetic:
  "p1d (a, b) (gx a b, gy a b) \<le> (- (27 / 25) - a\<^sup>2 + 2 * a * b) * p1 a b" if "(a, b) \<in> trapG1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p1d (a, b) (gx a b, gy a b) \<le> (- (27 / 25) - a\<^sup>2 + 2 * a * b) * p1 a b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p1d (a, b) (gx a b, gy a b) \<le> (- (27 / 25) - a\<^sup>2 + 2 * a * b) * p1 a b
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
(a, b) \<in> trapG1
[PROOF STEP]
have b: "0 \<le> b" "b \<le> 7.51"
    and a: "0 \<le> a" "a \<le> 8.24"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> trapG1

goal (1 subgoal):
 1. (0 \<le> b &&& b \<le> 751 / 10\<^sup>2) &&& 0 \<le> a &&& a \<le> 824 / 10\<^sup>2
[PROOF STEP]
by (auto simp: trapG1_def pos_quad_def)
[PROOF STATE]
proof (state)
this:
0 \<le> b
b \<le> 751 / 10\<^sup>2
0 \<le> a
a \<le> 824 / 10\<^sup>2

goal (1 subgoal):
 1. p1d (a, b) (gx a b, gy a b) \<le> (- (27 / 25) - a\<^sup>2 + 2 * a * b) * p1 a b
[PROOF STEP]
from g_arith_nonneg[OF a b]
[PROOF STATE]
proof (chain)
picking this:
0 \<le> g_arith a b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> g_arith a b

goal (1 subgoal):
 1. p1d (a, b) (gx a b, gy a b) \<le> (- (27 / 25) - a\<^sup>2 + 2 * a * b) * p1 a b
[PROOF STEP]
by (simp add: g_arith_def)
[PROOF STATE]
proof (state)
this:
p1d (a, b) (gx a b, gy a b) \<le> (- (27 / 25) - a\<^sup>2 + 2 * a * b) * p1 a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_component_set:
  "path_component_set S x =
    {y. (\<exists>g. path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_set S x = {y. \<exists>g. path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y}
[PROOF STEP]
by (auto simp: path_component_def)


[STATEMENT]
lemma subset_set_code[code_unfold]: "set xs \<subseteq> set ys \<longleftrightarrow> list_all (\<lambda>x. x \<in> set ys) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set xs \<subseteq> set ys) = list_all (\<lambda>x. x \<in> set ys) xs
[PROOF STEP]
unfolding list_all_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set xs \<subseteq> set ys) = (\<forall>x\<in>set xs. x \<in> set ys)
[PROOF STEP]
by auto


[STATEMENT]
lemma d_swap_unchanged: assumes len: "length F1 = m"
  and i0: "i \<noteq> 0" and i: "i < m" and ki: "k \<noteq> i" and km: "k \<le> m"
  and swap: "F2 = F1[i := F1 ! (i - 1), i - 1 := F1 ! i]"
shows "d F1 k = d F2 k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
let ?F1_M = "mat k n (\<lambda>(i, y). F1 ! i $ y)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
let ?F2_M = "mat k n (\<lambda>(i, y). F2 ! i $ y)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
have "\<exists> P. P \<in> carrier_mat k k \<and> det P \<in> {-1, 1} \<and> ?F2_M = P * ?F1_M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
 2. \<not> ?P \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
assume ki: "k < i"
[PROOF STATE]
proof (state)
this:
k < i

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
 2. \<not> ?P \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
hence H: "?F2_M = ?F1_M"
[PROOF STATE]
proof (prove)
using this:
k < i

goal (1 subgoal):
 1. mat k n (\<lambda>(i, y). F2 ! i $ y) = mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
unfolding swap
[PROOF STATE]
proof (prove)
using this:
k < i

goal (1 subgoal):
 1. mat k n (\<lambda>(ia, y). F1[i := F1 ! (i - 1), i - 1 := F1 ! i] ! ia $ y) = mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
by (intro eq_matI, auto)
[PROOF STATE]
proof (state)
this:
mat k n (\<lambda>(i, y). F2 ! i $ y) = mat k n (\<lambda>(i, y). F1 ! i $ y)

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
 2. \<not> ?P \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
let ?P = "1\<^sub>m k"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
 2. \<not> ?P \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
have "?P \<in> carrier_mat k k" "det ?P \<in> {-1, 1}" "?F2_M = ?P * ?F1_M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m k \<in> carrier_mat k k &&& det (1\<^sub>m k) \<in> {- (1::'b), 1::'b} &&& mat k n (\<lambda>(i, y). F2 ! i $ y) = 1\<^sub>m k * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
unfolding H
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m k \<in> carrier_mat k k &&& det (1\<^sub>m k) \<in> {- (1::'b), 1::'b} &&& mat k n (\<lambda>(i, y). F1 ! i $ y) = 1\<^sub>m k * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1\<^sub>m k \<in> carrier_mat k k
det (1\<^sub>m k) \<in> {- (1::?'b2), 1::?'b2}
mat k n (\<lambda>(i, y). F2 ! i $ y) = 1\<^sub>m k * mat k n (\<lambda>(i, y). F1 ! i $ y)

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
 2. \<not> ?P \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
1\<^sub>m k \<in> carrier_mat k k
det (1\<^sub>m k) \<in> {- (1::?'b2), 1::?'b2}
mat k n (\<lambda>(i, y). F2 ! i $ y) = 1\<^sub>m k * mat k n (\<lambda>(i, y). F1 ! i $ y)

goal (1 subgoal):
 1. \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)

goal (1 subgoal):
 1. \<not> k < i \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> k < i \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
assume "\<not> k < i"
[PROOF STATE]
proof (state)
this:
\<not> k < i

goal (1 subgoal):
 1. \<not> k < i \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
with ki
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> i
\<not> k < i
[PROOF STEP]
have ki: "k > i"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> i
\<not> k < i

goal (1 subgoal):
 1. i < k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < k

goal (1 subgoal):
 1. \<not> k < i \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
let ?P = "swaprows_mat k i (i - 1)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> k < i \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
from i0 ki
[PROOF STATE]
proof (chain)
picking this:
i \<noteq> 0
i < k
[PROOF STEP]
have neq: "i \<noteq> i - 1" and kmi: "i - 1 < k"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> 0
i < k

goal (1 subgoal):
 1. i \<noteq> i - 1 &&& i - 1 < k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<noteq> i - 1
i - 1 < k

goal (1 subgoal):
 1. \<not> k < i \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
have *: "?P \<in> carrier_mat k k" "det ?P \<in> {-1, 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swaprows_mat k i (i - 1) \<in> carrier_mat k k &&& det (swaprows_mat k i (i - 1)) \<in> {- (1::'b), 1::'b}
[PROOF STEP]
using det_swaprows_mat[OF ki kmi neq] ki
[PROOF STATE]
proof (prove)
using this:
det (swaprows_mat k i (i - 1)) = - (1::?'a)
i < k

goal (1 subgoal):
 1. swaprows_mat k i (i - 1) \<in> carrier_mat k k &&& det (swaprows_mat k i (i - 1)) \<in> {- (1::'b), 1::'b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
swaprows_mat k i (i - 1) \<in> carrier_mat k k
det (swaprows_mat k i (i - 1)) \<in> {- (1::?'b3), 1::?'b3}

goal (1 subgoal):
 1. \<not> k < i \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
from i len
[PROOF STATE]
proof (chain)
picking this:
i < m
length F1 = m
[PROOF STEP]
have iH: "i < length F1" "i - 1 < length F1"
[PROOF STATE]
proof (prove)
using this:
i < m
length F1 = m

goal (1 subgoal):
 1. i < length F1 &&& i - 1 < length F1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length F1
i - 1 < length F1

goal (1 subgoal):
 1. \<not> k < i \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
have "?P * ?F1_M = swaprows i (i - 1) ?F1_M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swaprows_mat k i (i - 1) * mat k n (\<lambda>(i, y). F1 ! i $ y) = swaprows i (i - 1) (mat k n (\<lambda>(i, y). F1 ! i $ y))
[PROOF STEP]
by (subst swaprows_mat[OF _ ki kmi], auto)
[PROOF STATE]
proof (state)
this:
swaprows_mat k i (i - 1) * mat k n (\<lambda>(i, y). F1 ! i $ y) = swaprows i (i - 1) (mat k n (\<lambda>(i, y). F1 ! i $ y))

goal (1 subgoal):
 1. \<not> k < i \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
swaprows_mat k i (i - 1) * mat k n (\<lambda>(i, y). F1 ! i $ y) = swaprows i (i - 1) (mat k n (\<lambda>(i, y). F1 ! i $ y))

goal (1 subgoal):
 1. \<not> k < i \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
have "\<dots> = ?F2_M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swaprows i (i - 1) (mat k n (\<lambda>(i, y). F1 ! i $ y)) = mat k n (\<lambda>(i, y). F2 ! i $ y)
[PROOF STEP]
unfolding swap
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swaprows i (i - 1) (mat k n (\<lambda>(i, y). F1 ! i $ y)) = mat k n (\<lambda>(ia, y). F1[i := F1 ! (i - 1), i - 1 := F1 ! i] ! ia $ y)
[PROOF STEP]
by (intro eq_matI, rename_tac ii jj,
          case_tac "ii = i", (insert iH, simp add: nth_list_update)[1],
          case_tac "ii = i - 1", insert iH neq ki, auto simp: nth_list_update)
[PROOF STATE]
proof (state)
this:
swaprows i (i - 1) (mat k n (\<lambda>(i, y). F1 ! i $ y)) = mat k n (\<lambda>(i, y). F2 ! i $ y)

goal (1 subgoal):
 1. \<not> k < i \<Longrightarrow> \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
swaprows_mat k i (i - 1) * mat k n (\<lambda>(i, y). F1 ! i $ y) = mat k n (\<lambda>(i, y). F2 ! i $ y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
swaprows_mat k i (i - 1) * mat k n (\<lambda>(i, y). F1 ! i $ y) = mat k n (\<lambda>(i, y). F2 ! i $ y)

goal (1 subgoal):
 1. \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
swaprows_mat k i (i - 1) * mat k n (\<lambda>(i, y). F1 ! i $ y) = mat k n (\<lambda>(i, y). F2 ! i $ y)
swaprows_mat k i (i - 1) \<in> carrier_mat k k
det (swaprows_mat k i (i - 1)) \<in> {- (1::?'b3), 1::?'b3}

goal (1 subgoal):
 1. \<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)
[PROOF STEP]
obtain P where P: "P \<in> carrier_mat k k" and detP: "det P \<in> {-1, 1}" and H': "?F2_M = P * ?F1_M"
[PROOF STATE]
proof (prove)
using this:
\<exists>P. P \<in> carrier_mat k k \<and> det P \<in> {- 1, 1} \<and> mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>P \<in> carrier_mat k k; det P \<in> {- 1, 1}; mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<in> carrier_mat k k
det P \<in> {- 1, 1}
mat k n (\<lambda>(i, y). F2 ! i $ y) = P * mat k n (\<lambda>(i, y). F1 ! i $ y)

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
have "d F2 k = det (gs.Gramian_matrix F2 k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d F2 k = det (gs.Gramian_matrix F2 k)
[PROOF STEP]
unfolding d_def gs.Gramian_determinant_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (gs.Gramian_matrix F2 k) = det (gs.Gramian_matrix F2 k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d F2 k = det (gs.Gramian_matrix F2 k)

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d F2 k = det (gs.Gramian_matrix F2 k)

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
have "\<dots> = det (?F2_M * ?F2_M\<^sup>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (gs.Gramian_matrix F2 k) = det (mat k n (\<lambda>(i, y). F2 ! i $ y) * (mat k n (\<lambda>(i, y). F2 ! i $ y))\<^sup>T)
[PROOF STEP]
unfolding gs.Gramian_matrix_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat k n (\<lambda>(i, y). F2 ! i $ y) * (mat k n (\<lambda>(i, y). F2 ! i $ y))\<^sup>T) = det (mat k n (\<lambda>(i, y). F2 ! i $ y) * (mat k n (\<lambda>(i, y). F2 ! i $ y))\<^sup>T)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (gs.Gramian_matrix F2 k) = det (mat k n (\<lambda>(i, y). F2 ! i $ y) * (mat k n (\<lambda>(i, y). F2 ! i $ y))\<^sup>T)

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (gs.Gramian_matrix F2 k) = det (mat k n (\<lambda>(i, y). F2 ! i $ y) * (mat k n (\<lambda>(i, y). F2 ! i $ y))\<^sup>T)

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
have "?F2_M * ?F2_M\<^sup>T = ?F2_M * (?F1_M\<^sup>T * P\<^sup>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat k n (\<lambda>(i, y). F2 ! i $ y) * (mat k n (\<lambda>(i, y). F2 ! i $ y))\<^sup>T = mat k n (\<lambda>(i, y). F2 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T)
[PROOF STEP]
unfolding H'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * mat k n (\<lambda>(i, y). F1 ! i $ y) * (P * mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T = P * mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T)
[PROOF STEP]
by (subst transpose_mult[OF P], auto)
[PROOF STATE]
proof (state)
this:
mat k n (\<lambda>(i, y). F2 ! i $ y) * (mat k n (\<lambda>(i, y). F2 ! i $ y))\<^sup>T = mat k n (\<lambda>(i, y). F2 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T)

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat k n (\<lambda>(i, y). F2 ! i $ y) * (mat k n (\<lambda>(i, y). F2 ! i $ y))\<^sup>T = mat k n (\<lambda>(i, y). F2 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T)

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
have "\<dots> = P * (?F1_M * (?F1_M\<^sup>T * P\<^sup>T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat k n (\<lambda>(i, y). F2 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T) = P * (mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T))
[PROOF STEP]
unfolding H'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T) = P * (mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T))
[PROOF STEP]
by (subst assoc_mult_mat[OF P], auto)
[PROOF STATE]
proof (state)
this:
mat k n (\<lambda>(i, y). F2 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T) = P * (mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T))

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat k n (\<lambda>(i, y). F2 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T) = P * (mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T))

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
have "det \<dots> = det P * det (?F1_M * (?F1_M\<^sup>T * P\<^sup>T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (P * (mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T))) = det P * det (mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T))
[PROOF STEP]
by (rule det_mult[OF P], insert P, auto)
[PROOF STATE]
proof (state)
this:
det (P * (mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T))) = det P * det (mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T))

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (P * (mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T))) = det P * det (mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T))

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
have "?F1_M * (?F1_M\<^sup>T * P\<^sup>T) = (?F1_M * ?F1_M\<^sup>T) * P\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T) = mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T
[PROOF STEP]
by (subst assoc_mult_mat, insert P, auto)
[PROOF STATE]
proof (state)
this:
mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T) = mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat k n (\<lambda>(i, y). F1 ! i $ y) * ((mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T) = mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
have "det \<dots> = det (?F1_M * ?F1_M\<^sup>T) * det P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T) = det (mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T) * det P
[PROOF STEP]
by (subst det_mult, insert P, auto simp: det_transpose)
[PROOF STATE]
proof (state)
this:
det (mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T) = det (mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T) * det P

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T * P\<^sup>T) = det (mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T) * det P

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
have "det (?F1_M * ?F1_M\<^sup>T) = det (gs.Gramian_matrix F1 k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T) = det (gs.Gramian_matrix F1 k)
[PROOF STEP]
unfolding gs.Gramian_matrix_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T) = det (mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T) = det (gs.Gramian_matrix F1 k)

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (mat k n (\<lambda>(i, y). F1 ! i $ y) * (mat k n (\<lambda>(i, y). F1 ! i $ y))\<^sup>T) = det (gs.Gramian_matrix F1 k)

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
have "\<dots> = d F1 k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (gs.Gramian_matrix F1 k) = d F1 k
[PROOF STEP]
unfolding d_def gs.Gramian_determinant_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (gs.Gramian_matrix F1 k) = det (gs.Gramian_matrix F1 k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (gs.Gramian_matrix F1 k) = d F1 k

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d F2 k = det P * (d F1 k * det P)
[PROOF STEP]
have "d F2 k = (det P * det P) * d F1 k"
[PROOF STATE]
proof (prove)
using this:
d F2 k = det P * (d F1 k * det P)

goal (1 subgoal):
 1. d F2 k = det P * det P * d F1 k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d F2 k = det P * det P * d F1 k

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d F2 k = det P * det P * d F1 k

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
have "det P * det P = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det P * det P = 1
[PROOF STEP]
using detP
[PROOF STATE]
proof (prove)
using this:
det P \<in> {- 1, 1}

goal (1 subgoal):
 1. det P * det P = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
det P * det P = 1

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d F2 k = 1 * d F1 k
[PROOF STEP]
show "d F1 k = d F2 k"
[PROOF STATE]
proof (prove)
using this:
d F2 k = 1 * d F1 k

goal (1 subgoal):
 1. d F1 k = d F2 k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d F1 k = d F2 k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "((\<lambda>x::real. (x^2 - 1) / \<bar>x - 1\<bar>) \<longlongrightarrow> -2) (at_left 1)"
      "((\<lambda>x::real. (x^2 - 1) / \<bar>x - 1\<bar>) \<longlongrightarrow> 2) (at_right 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (x\<^sup>2 - 1) / \<bar>x - 1\<bar>) \<longlongrightarrow> - 2) (at_left 1) &&& ((\<lambda>x. (x\<^sup>2 - 1) / \<bar>x - 1\<bar>) \<longlongrightarrow> 2) (at_right 1)
[PROOF STEP]
by real_asymp+


[STATEMENT]
lemma r_distinguishable_k_Suc_k_alt_def :
  "r_distinguishable_k M q1 q2 (Suc k) = (r_distinguishable_k M q1 q2 k
                                          \<or> (\<exists> x \<in> (inputs M) . \<forall> y q1' q2' . ((q1,x,y,q1') \<in> transitions M \<and> (q2,x,y,q2') \<in> transitions M) \<longrightarrow> r_distinguishable_k M q1' q2' k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r_distinguishable_k M q1 q2 (Suc k) = (r_distinguishable_k M q1 q2 k \<or> (\<exists>x\<in>FSM.inputs M. \<forall>y q1' q2'. (q1, x, y, q1') \<in> FSM.transitions M \<and> (q2, x, y, q2') \<in> FSM.transitions M \<longrightarrow> r_distinguishable_k M q1' q2' k))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma rev_sub_add:
  assumes "g \<in> carrier P"
  assumes "f \<in> carrier P"
  assumes "h \<in>carrier P"
  shows "rev_sub g (f \<oplus>\<^bsub>P\<^esub> h) = (rev_sub g f) \<oplus>\<^bsub>P\<^esub> (rev_sub g h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev_compose R g (f \<oplus>\<^bsub>P\<^esub> h) = rev_compose R g f \<oplus>\<^bsub>P\<^esub> rev_compose R g h
[PROOF STEP]
using rev_sub_is_hom assms ring_hom_add
[PROOF STATE]
proof (prove)
using this:
?g \<in> carrier P \<Longrightarrow> rev_compose R ?g \<in> ring_hom P P
g \<in> carrier P
f \<in> carrier P
h \<in> carrier P
\<lbrakk>?h \<in> ring_hom ?R ?S; ?x \<in> carrier ?R; ?y \<in> carrier ?R\<rbrakk> \<Longrightarrow> ?h (?x \<oplus>\<^bsub>?R\<^esub> ?y) = ?h ?x \<oplus>\<^bsub>?S\<^esub> ?h ?y

goal (1 subgoal):
 1. rev_compose R g (f \<oplus>\<^bsub>P\<^esub> h) = rev_compose R g f \<oplus>\<^bsub>P\<^esub> rev_compose R g h
[PROOF STEP]
by fastforce


[STATEMENT]
lemma in_sccs_verts_conv_reachable:
    "S \<in> sccs_verts \<longleftrightarrow> S \<noteq> {} \<and> (\<forall>u \<in> S. \<forall>v \<in> S. u \<rightarrow>\<^sup>*\<^bsub>G\<^esub> v) \<and> (\<forall>u \<in> S. \<forall>v. v \<notin> S \<longrightarrow> \<not>u \<rightarrow>\<^sup>*\<^bsub>G\<^esub> v \<or> \<not>v \<rightarrow>\<^sup>*\<^bsub>G\<^esub> u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S \<in> sccs_verts) = (S \<noteq> {} \<and> (\<forall>u\<in>S. \<forall>v\<in>S. u \<rightarrow>\<^sup>* v) \<and> (\<forall>u\<in>S. \<forall>v. v \<notin> S \<longrightarrow> \<not> u \<rightarrow>\<^sup>* v \<or> \<not> v \<rightarrow>\<^sup>* u))
[PROOF STEP]
by (simp add: sccs_verts_def)


[STATEMENT]
lemma limit_ordinal_omega: "limit_ordinal \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limit_ordinal \<omega>
[PROOF STEP]
apply (rule limit_ordinalI[rule_format], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x < \<omega> \<Longrightarrow> oSuc x < \<omega>
[PROOF STEP]
apply (drule less_omegaD, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n. oSuc (ordinal_of_nat n) < \<omega>
[PROOF STEP]
apply (subgoal_tac "ordinal_of_nat (Suc n) < \<omega>", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x n. ordinal_of_nat (Suc n) < \<omega>
[PROOF STEP]
apply (simp only: nat_less_omega)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bin_empty_iff: "S = {} \<longleftrightarrow> (a :: binA) \<notin> S \<and> 1-a \<notin> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S = {}) = (a \<notin> S \<and> 1 - a \<notin> S)
[PROOF STEP]
using bin_swap_induct[of "\<lambda>a. a \<notin> S"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<notin> S; 1 - ?a \<notin> S\<rbrakk> \<Longrightarrow> ?c \<notin> S

goal (1 subgoal):
 1. (S = {}) = (a \<notin> S \<and> 1 - a \<notin> S)
[PROOF STEP]
by blast


[STATEMENT]
lemma instanceFDual: "instanceF u (dual p q r A) = dual p q r (instanceF u A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. instanceF u (dual p q r A) = dual p q r (instanceF u A)
[PROOF STEP]
by(induct A) (simp_all add: instanceF_def subFDual)


[STATEMENT]
lemma emeasure_lborel_ball_finite: "emeasure lborel (ball c r) < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel (ball c r) < \<infinity>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure lborel (ball c r) < \<infinity>
[PROOF STEP]
have "bounded (ball c r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (ball c r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bounded (ball c r)

goal (1 subgoal):
 1. emeasure lborel (ball c r) < \<infinity>
[PROOF STEP]
from bounded_subset_cbox_symmetric[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>a. ball c r \<subseteq> cbox (- a) a \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain a where a: "ball c r \<subseteq> cbox (-a) a"
[PROOF STATE]
proof (prove)
using this:
(\<And>a. ball c r \<subseteq> cbox (- a) a \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>a. ball c r \<subseteq> cbox (- a) a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ball c r \<subseteq> cbox (- a) a

goal (1 subgoal):
 1. emeasure lborel (ball c r) < \<infinity>
[PROOF STEP]
hence "emeasure lborel (ball c r) \<le> emeasure lborel (cbox (-a) a)"
[PROOF STATE]
proof (prove)
using this:
ball c r \<subseteq> cbox (- a) a

goal (1 subgoal):
 1. emeasure lborel (ball c r) \<le> emeasure lborel (cbox (- a) a)
[PROOF STEP]
by (intro emeasure_mono) auto
[PROOF STATE]
proof (state)
this:
emeasure lborel (ball c r) \<le> emeasure lborel (cbox (- a) a)

goal (1 subgoal):
 1. emeasure lborel (ball c r) < \<infinity>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure lborel (ball c r) \<le> emeasure lborel (cbox (- a) a)

goal (1 subgoal):
 1. emeasure lborel (ball c r) < \<infinity>
[PROOF STEP]
have "\<dots> < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel (cbox (- a) a) < \<infinity>
[PROOF STEP]
by (simp add: emeasure_lborel_cbox_eq)
[PROOF STATE]
proof (state)
this:
emeasure lborel (cbox (- a) a) < \<infinity>

goal (1 subgoal):
 1. emeasure lborel (ball c r) < \<infinity>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure lborel (ball c r) < \<infinity>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure lborel (ball c r) < \<infinity>

goal (1 subgoal):
 1. emeasure lborel (ball c r) < \<infinity>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure lborel (ball c r) < \<infinity>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_interval_distr:
  fixes f :: "nat \<Rightarrow> 'a::dioid_one_zero"
  assumes "m \<le> n"
  shows "(\<Sum>i=m..n. f(i)) \<cdot> y = (\<Sum>i=m..n. (f(i) \<cdot> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
have "(\<Sum>i=m..n. f(i)) \<cdot> y = \<Sum>(f ` {m..n}) \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {m..n} \<cdot> y = \<Sum> (f ` {m..n}) \<cdot> y
[PROOF STEP]
by (metis finite_atLeastAtMost sum_image)
[PROOF STATE]
proof (state)
this:
sum f {m..n} \<cdot> y = \<Sum> (f ` {m..n}) \<cdot> y

goal (1 subgoal):
 1. sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {m..n} \<cdot> y = \<Sum> (f ` {m..n}) \<cdot> y

goal (1 subgoal):
 1. sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
have "... = \<Sum>{x \<cdot> y |x. x \<in> f ` {m..n}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> (f ` {m..n}) \<cdot> y = \<Sum> {x \<cdot> y |x. x \<in> f ` {m..n}}
[PROOF STEP]
by (metis calculation finite_atLeastAtMost finite_imageI fset_to_im sum_distr)
[PROOF STATE]
proof (state)
this:
\<Sum> (f ` {m..n}) \<cdot> y = \<Sum> {x \<cdot> y |x. x \<in> f ` {m..n}}

goal (1 subgoal):
 1. sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sum> (f ` {m..n}) \<cdot> y = \<Sum> {x \<cdot> y |x. x \<in> f ` {m..n}}

goal (1 subgoal):
 1. sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
have "... = \<Sum>((\<lambda>i. f(i) \<cdot> y) ` {m..n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {x \<cdot> y |x. x \<in> f ` {m..n}} = \<Sum> ((\<lambda>i. f i \<cdot> y) ` {m..n})
[PROOF STEP]
by (auto intro: sum.cong)
[PROOF STATE]
proof (state)
this:
\<Sum> {x \<cdot> y |x. x \<in> f ` {m..n}} = \<Sum> ((\<lambda>i. f i \<cdot> y) ` {m..n})

goal (1 subgoal):
 1. sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sum> {x \<cdot> y |x. x \<in> f ` {m..n}} = \<Sum> ((\<lambda>i. f i \<cdot> y) ` {m..n})

goal (1 subgoal):
 1. sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
have "... = (\<Sum>i=m..n. (f(i) \<cdot> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> ((\<lambda>i. f i \<cdot> y) ` {m..n}) = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
by (metis finite_atLeastAtMost sum_image)
[PROOF STATE]
proof (state)
this:
\<Sum> ((\<lambda>i. f i \<cdot> y) ` {m..n}) = (\<Sum>i = m..n. f i \<cdot> y)

goal (1 subgoal):
 1. sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)

goal (1 subgoal):
 1. sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum f {m..n} \<cdot> y = (\<Sum>i = m..n. f i \<cdot> y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma czero_le_sgn_iff [simp]: "0 \<le> sgn x \<longleftrightarrow> 0 \<le> x"
  for x :: complex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> sgn x) = (0 \<le> x)
[PROOF STEP]
using cmod_eq_Re divide_eq_0_iff less_eq_complex_def
[PROOF STATE]
proof (prove)
using this:
Im ?z = 0 \<Longrightarrow> cmod ?z = \<bar>Re ?z\<bar>
(?a / ?b = (0::?'a)) = (?a = (0::?'a) \<or> ?b = (0::?'a))
(?x \<le> ?y) = (Re ?x \<le> Re ?y \<and> Im ?x = Im ?y)

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


[STATEMENT]
lemma ln_minus_Lambert_W':
  assumes "x \<in> {-exp (-1)..<0}"
  shows   "ln (-Lambert_W' x) = ln (-x) - Lambert_W' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (- Lambert_W' x) = ln (- x) - Lambert_W' x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln (- Lambert_W' x) = ln (- x) - Lambert_W' x
[PROOF STEP]
have "exp (ln (-x) - Lambert_W' x) = -Lambert_W' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (ln (- x) - Lambert_W' x) = - Lambert_W' x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> {- exp (- 1)..<0}

goal (1 subgoal):
 1. exp (ln (- x) - Lambert_W' x) = - Lambert_W' x
[PROOF STEP]
by (simp add: exp_diff exp_Lambert_W')
[PROOF STATE]
proof (state)
this:
exp (ln (- x) - Lambert_W' x) = - Lambert_W' x

goal (1 subgoal):
 1. ln (- Lambert_W' x) = ln (- x) - Lambert_W' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (ln (- x) - Lambert_W' x) = - Lambert_W' x

goal (1 subgoal):
 1. ln (- Lambert_W' x) = ln (- x) - Lambert_W' x
[PROOF STEP]
have "\<dots> = exp (ln (-Lambert_W' x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Lambert_W' x = exp (ln (- Lambert_W' x))
[PROOF STEP]
using Lambert_W'_neg[of x]
[PROOF STATE]
proof (prove)
using this:
Lambert_W' x < 0

goal (1 subgoal):
 1. - Lambert_W' x = exp (ln (- Lambert_W' x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- Lambert_W' x = exp (ln (- Lambert_W' x))

goal (1 subgoal):
 1. ln (- Lambert_W' x) = ln (- x) - Lambert_W' x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
exp (ln (- x) - Lambert_W' x) = exp (ln (- Lambert_W' x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
exp (ln (- x) - Lambert_W' x) = exp (ln (- Lambert_W' x))

goal (1 subgoal):
 1. ln (- Lambert_W' x) = ln (- x) - Lambert_W' x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ln (- Lambert_W' x) = ln (- x) - Lambert_W' x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma atLeastLessThan_less:
"({0..<m} < {0..<n}) = ((m::nat) < n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({0..<m} \<subset> {0..<n}) = (m < n)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ({0..<m} \<subset> {0..<n}) = (m < n)
[PROOF STEP]
have "({0..<m} < {0..<n}) = ({0..<m} \<le> {0..<n} \<and> {0..<m} ~= {0..<n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({0..<m} \<subset> {0..<n}) = ({0..<m} \<subseteq> {0..<n} \<and> {0..<m} \<noteq> {0..<n})
[PROOF STEP]
using subset_iff_psubset_eq
[PROOF STATE]
proof (prove)
using this:
(?A \<subseteq> ?B) = (?A \<subset> ?B \<or> ?A = ?B)

goal (1 subgoal):
 1. ({0..<m} \<subset> {0..<n}) = ({0..<m} \<subseteq> {0..<n} \<and> {0..<m} \<noteq> {0..<n})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
({0..<m} \<subset> {0..<n}) = ({0..<m} \<subseteq> {0..<n} \<and> {0..<m} \<noteq> {0..<n})

goal (1 subgoal):
 1. ({0..<m} \<subset> {0..<n}) = (m < n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
({0..<m} \<subset> {0..<n}) = ({0..<m} \<subseteq> {0..<n} \<and> {0..<m} \<noteq> {0..<n})

goal (1 subgoal):
 1. ({0..<m} \<subset> {0..<n}) = (m < n)
[PROOF STEP]
have "\<dots> = (m \<le> n \<and> m ~= n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({0..<m} \<subseteq> {0..<n} \<and> {0..<m} \<noteq> {0..<n}) = (m \<le> n \<and> m \<noteq> n)
[PROOF STEP]
using atLeastLessThan_less_eq atLeastLessThan_injective
[PROOF STATE]
proof (prove)
using this:
({0..<?m} \<subseteq> {0..<?n}) = (?m \<le> ?n)
{0..<?m} = {0..<?n} \<Longrightarrow> ?m = ?n

goal (1 subgoal):
 1. ({0..<m} \<subseteq> {0..<n} \<and> {0..<m} \<noteq> {0..<n}) = (m \<le> n \<and> m \<noteq> n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
({0..<m} \<subseteq> {0..<n} \<and> {0..<m} \<noteq> {0..<n}) = (m \<le> n \<and> m \<noteq> n)

goal (1 subgoal):
 1. ({0..<m} \<subset> {0..<n}) = (m < n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
({0..<m} \<subseteq> {0..<n} \<and> {0..<m} \<noteq> {0..<n}) = (m \<le> n \<and> m \<noteq> n)

goal (1 subgoal):
 1. ({0..<m} \<subset> {0..<n}) = (m < n)
[PROOF STEP]
have "\<dots> = (m < n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m \<le> n \<and> m \<noteq> n) = (m < n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(m \<le> n \<and> m \<noteq> n) = (m < n)

goal (1 subgoal):
 1. ({0..<m} \<subset> {0..<n}) = (m < n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
({0..<m} \<subset> {0..<n}) = (m < n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
({0..<m} \<subset> {0..<n}) = (m < n)

goal (1 subgoal):
 1. ({0..<m} \<subset> {0..<n}) = (m < n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
({0..<m} \<subset> {0..<n}) = (m < n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iT_Div_mem_iff_Int: "
  0 < k \<Longrightarrow> x \<in> (I \<oslash> k) = (I \<inter> [x * k\<dots>,k - Suc 0] \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> (x \<in> I \<oslash> k) = (I \<inter> [x * k\<dots>,k - Suc 0] \<noteq> {})
[PROOF STEP]
apply (simp add: ex_in_conv[symmetric] iT_Div_mem_iff iT_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> (\<exists>y\<in>I. y div k = x) = (\<exists>xa. xa \<in> I \<and> x * k \<le> xa \<and> xa \<le> x * k + k - Suc 0)
[PROOF STEP]
apply (simp add: le_less_div_conv[symmetric] add.commute[of k])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> (\<exists>y\<in>I. x * k \<le> y \<and> y < x * k + k) = (\<exists>xa. xa \<in> I \<and> x * k \<le> xa \<and> xa \<le> x * k + k - Suc 0)
[PROOF STEP]
apply (subst less_eq_le_pred, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> (\<exists>y\<in>I. x * k \<le> y \<and> y \<le> x * k + k - Suc 0) = (\<exists>xa. xa \<in> I \<and> x * k \<le> xa \<and> xa \<le> x * k + k - Suc 0)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma GreenThm_typeII_twoChain:
  shows "two_chain_integral two_chain (partial_vector_derivative (\<lambda>a. (F a) \<bullet> j)  i) = one_chain_line_integral F {j} (two_chain_boundary two_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_chain_integral two_chain (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) = one_chain_line_integral F {j} (two_chain_boundary two_chain)
[PROOF STEP]
proof (simp add: two_chain_boundary_def one_chain_line_integral_def two_chain_integral_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) = (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
let ?F_a' = "partial_vector_derivative (\<lambda>a. (F a) \<bullet> j)  i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) = (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
have "(\<Sum>(k,g)\<in> boundary twoCube. k * line_integral F {j} g) = integral (cubeImage twoCube) (\<lambda>a. ?F_a' a)"
    if "twoCube \<in> two_chain" for twoCube
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g) = integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
[PROOF STEP]
using green_typeII_cube.GreenThm_typeII_twoCube(1) valid_typeII_div F_anal_valid one_chain_line_integral_def valid_two_chain_def
[PROOF STATE]
proof (prove)
using this:
green_typeII_cube ?i ?j ?twoC ?F \<Longrightarrow> integral (cubeImage ?twoC) (partial_vector_derivative (\<lambda>x. ?F x \<bullet> ?j) ?i) = one_chain_line_integral ?F {?j} (boundary ?twoC)
valid_typeII_division s two_chain
\<forall>twoC\<in>two_chain. analytically_valid (cubeImage twoC) (\<lambda>x. F x \<bullet> j) i
one_chain_line_integral ?F ?b ?C \<equiv> \<Sum>(k, g)\<in>?C. real_of_int k * line_integral ?F ?b g
valid_two_chain ?twoChain \<equiv> (\<forall>twoCube\<in>?twoChain. valid_two_cube twoCube) \<and> pairwise (\<lambda>c1 c2. boundary c1 \<inter> boundary c2 = {}) ?twoChain \<and> inj_on cubeImage ?twoChain

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g) = integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
[PROOF STEP]
by (simp add: R2_axioms green_typeII_cube_axioms_def green_typeII_cube_def that)
[PROOF STATE]
proof (state)
this:
?twoCube \<in> two_chain \<Longrightarrow> (\<Sum>(k, g)\<in>boundary ?twoCube. real_of_int k * line_integral F {j} g) = integral (cubeImage ?twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)

goal (1 subgoal):
 1. (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) = (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?twoCube \<in> two_chain \<Longrightarrow> (\<Sum>(k, g)\<in>boundary ?twoCube. real_of_int k * line_integral F {j} g) = integral (cubeImage ?twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
[PROOF STEP]
have double_sum_eq_sum:
    "(\<Sum>twoCube\<in>(two_chain).(\<Sum>(k,g)\<in> boundary twoCube. k * line_integral F {j} g))
                     =  (\<Sum>twoCube\<in>(two_chain). integral (cubeImage twoCube) (\<lambda>a. ?F_a' a))"
[PROOF STATE]
proof (prove)
using this:
?twoCube \<in> two_chain \<Longrightarrow> (\<Sum>(k, g)\<in>boundary ?twoCube. real_of_int k * line_integral F {j} g) = integral (cubeImage ?twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)

goal (1 subgoal):
 1. (\<Sum>twoCube\<in>two_chain. \<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g) = (\<Sum>twoCube\<in>two_chain. integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i))
[PROOF STEP]
using Finite_Cartesian_Product.sum_cong_aux
[PROOF STATE]
proof (prove)
using this:
?twoCube \<in> two_chain \<Longrightarrow> (\<Sum>(k, g)\<in>boundary ?twoCube. real_of_int k * line_integral F {j} g) = integral (cubeImage ?twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)
(\<And>x. x \<in> ?A \<Longrightarrow> ?f x = ?g x) \<Longrightarrow> sum ?f ?A = sum ?g ?A

goal (1 subgoal):
 1. (\<Sum>twoCube\<in>two_chain. \<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g) = (\<Sum>twoCube\<in>two_chain. integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>twoCube\<in>two_chain. \<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g) = (\<Sum>twoCube\<in>two_chain. integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i))

goal (1 subgoal):
 1. (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) = (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
have pairwise_disjoint_boundaries: "\<forall>x\<in> (boundary ` two_chain). (\<forall>y\<in> (boundary ` two_chain). (x \<noteq> y \<longrightarrow> (x \<inter> y = {})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>boundary ` two_chain. \<forall>y\<in>boundary ` two_chain. x \<noteq> y \<longrightarrow> x \<inter> y = {}
[PROOF STEP]
using valid_typeII_div
[PROOF STATE]
proof (prove)
using this:
valid_typeII_division s two_chain

goal (1 subgoal):
 1. \<forall>x\<in>boundary ` two_chain. \<forall>y\<in>boundary ` two_chain. x \<noteq> y \<longrightarrow> x \<inter> y = {}
[PROOF STEP]
by (fastforce simp add:  image_def valid_two_chain_def pairwise_def)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>boundary ` two_chain. \<forall>y\<in>boundary ` two_chain. x \<noteq> y \<longrightarrow> x \<inter> y = {}

goal (1 subgoal):
 1. (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) = (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
have finite_boundaries: "\<forall>B \<in> (boundary` two_chain). finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>B\<in>boundary ` two_chain. finite B
[PROOF STEP]
using valid_typeII_div image_iff
[PROOF STATE]
proof (prove)
using this:
valid_typeII_division s two_chain
(?z \<in> ?f ` ?A) = (\<exists>x\<in>?A. ?z = ?f x)

goal (1 subgoal):
 1. \<forall>B\<in>boundary ` two_chain. finite B
[PROOF STEP]
by (fastforce simp add: valid_two_cube_def valid_two_chain_def)
[PROOF STATE]
proof (state)
this:
\<forall>B\<in>boundary ` two_chain. finite B

goal (1 subgoal):
 1. (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) = (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
have boundary_inj: "inj_on boundary two_chain"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on boundary two_chain
[PROOF STEP]
using valid_typeII_div
[PROOF STATE]
proof (prove)
using this:
valid_typeII_division s two_chain

goal (1 subgoal):
 1. inj_on boundary two_chain
[PROOF STEP]
by (force simp add: valid_two_cube_def valid_two_chain_def pairwise_def inj_on_def)
[PROOF STATE]
proof (state)
this:
inj_on boundary two_chain

goal (1 subgoal):
 1. (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) = (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
have "(\<Sum>x\<in>(\<Union>x\<in>two_chain. boundary x). case x of (k, g) \<Rightarrow> k * line_integral F {j} g) =
                      (\<Sum>twoCube\<in>(two_chain).(\<Sum>(k,g)\<in> boundary twoCube. k * line_integral F {j} g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = (\<Sum>twoCube\<in>two_chain. \<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g)
[PROOF STEP]
using sum.reindex[OF boundary_inj,  of "\<lambda>x. (\<Sum>(k,g)\<in> x. k * line_integral F {j} g)"]
[PROOF STATE]
proof (prove)
using this:
sum (sum (\<lambda>(k, g). real_of_int k * line_integral F {j} g)) (boundary ` two_chain) = sum (sum (\<lambda>(k, g). real_of_int k * line_integral F {j} g) \<circ> boundary) two_chain

goal (1 subgoal):
 1. (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = (\<Sum>twoCube\<in>two_chain. \<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g)
[PROOF STEP]
using sum.Union_disjoint[OF finite_boundaries
        pairwise_disjoint_boundaries,
        of "\<lambda>x. case x of (k, g) \<Rightarrow> (k::int) * line_integral F {j} g"]
[PROOF STATE]
proof (prove)
using this:
sum (sum (\<lambda>(k, g). real_of_int k * line_integral F {j} g)) (boundary ` two_chain) = sum (sum (\<lambda>(k, g). real_of_int k * line_integral F {j} g) \<circ> boundary) two_chain
(\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = (sum \<circ> sum) (\<lambda>x. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) (boundary ` two_chain)

goal (1 subgoal):
 1. (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = (\<Sum>twoCube\<in>two_chain. \<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = (\<Sum>twoCube\<in>two_chain. \<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g)

goal (1 subgoal):
 1. (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) = (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = (\<Sum>twoCube\<in>two_chain. \<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g)
[PROOF STEP]
show "(\<Sum>C\<in>two_chain. integral (cubeImage C) (\<lambda>a. ?F_a' a)) = (\<Sum>x\<in>(\<Union>x\<in>two_chain. boundary x). case x of (k, g) \<Rightarrow> k * line_integral F {j} g)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = (\<Sum>twoCube\<in>two_chain. \<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g)

goal (1 subgoal):
 1. (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) = (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
using double_sum_eq_sum
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g) = (\<Sum>twoCube\<in>two_chain. \<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g)
(\<Sum>twoCube\<in>two_chain. \<Sum>(k, g)\<in>boundary twoCube. real_of_int k * line_integral F {j} g) = (\<Sum>twoCube\<in>two_chain. integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i))

goal (1 subgoal):
 1. (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) = (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) = (\<Sum>x\<in>\<Union> (boundary ` two_chain). case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem kummers_test_convergence:
  fixes f p :: "nat \<Rightarrow> real"
  assumes pos_f: "eventually (\<lambda>n. f n > 0) sequentially"
  assumes nonneg_p: "eventually (\<lambda>n. p n \<ge> 0) sequentially"
  defines "l \<equiv> liminf (\<lambda>n. ereal (p n * f n / f (Suc n) - p (Suc n)))"
  assumes l: "l > 0"
  shows   "summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f
[PROOF STEP]
unfolding summable_iff_convergent'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
define r where "r = (if l = \<infinity> then 1 else real_of_ereal l / 2)"
[PROOF STATE]
proof (state)
this:
r = (if l = \<infinity> then 1 else real_of_ereal l / 2)

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
from l
[PROOF STATE]
proof (chain)
picking this:
0 < l
[PROOF STEP]
have "r > 0 \<and> of_real r < l"
[PROOF STATE]
proof (prove)
using this:
0 < l

goal (1 subgoal):
 1. 0 < r \<and> ereal (of_real r) < l
[PROOF STEP]
by (cases l) (simp_all add: r_def)
[PROOF STATE]
proof (state)
this:
0 < r \<and> ereal (of_real r) < l

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
hence r: "r > 0" "of_real r < l"
[PROOF STATE]
proof (prove)
using this:
0 < r \<and> ereal (of_real r) < l

goal (1 subgoal):
 1. 0 < r &&& ereal (of_real r) < l
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
0 < r
ereal (of_real r) < l

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
hence "eventually (\<lambda>n. p n * f n / f (Suc n) - p (Suc n) > r) sequentially"
[PROOF STATE]
proof (prove)
using this:
0 < r
ereal (of_real r) < l

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. r < p n * f n / f (Suc n) - p (Suc n)
[PROOF STEP]
unfolding l_def
[PROOF STATE]
proof (prove)
using this:
0 < r
ereal (of_real r) < liminf (\<lambda>n. ereal (p n * f n / f (Suc n) - p (Suc n)))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. r < p n * f n / f (Suc n) - p (Suc n)
[PROOF STEP]
by (force dest: less_LiminfD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. r < p n * f n / f (Suc n) - p (Suc n)

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. r < p n * f n / f (Suc n) - p (Suc n)

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
from pos_f
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 0 < f n
[PROOF STEP]
have "eventually (\<lambda>n. f (Suc n) > 0) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < f n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < f (Suc n)
[PROOF STEP]
by (subst eventually_sequentially_Suc)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < f (Suc n)

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. r < p n * f n / f (Suc n) - p (Suc n)
\<forall>\<^sub>F n in sequentially. 0 < f (Suc n)
[PROOF STEP]
have "eventually (\<lambda>n. p n * f n - p (Suc n) * f (Suc n) > r * f (Suc n)) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. r < p n * f n / f (Suc n) - p (Suc n)
\<forall>\<^sub>F n in sequentially. 0 < f (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. r * f (Suc n) < p n * f n - p (Suc n) * f (Suc n)
[PROOF STEP]
by eventually_elim (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. r * f (Suc n) < p n * f n - p (Suc n) * f (Suc n)

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
from eventually_conj[OF pos_f eventually_conj[OF nonneg_p this]]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. 0 < f x \<and> 0 \<le> p x \<and> r * f (Suc x) < p x * f x - p (Suc x) * f (Suc x)
[PROOF STEP]
obtain m where m: "\<And>n. n \<ge> m \<Longrightarrow> f n > 0" "\<And>n. n \<ge> m \<Longrightarrow> p n \<ge> 0"
        "\<And>n. n \<ge> m \<Longrightarrow> p n * f n - p (Suc n) * f (Suc n) > r * f (Suc n)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. 0 < f x \<and> 0 \<le> p x \<and> r * f (Suc x) < p x * f x - p (Suc x) * f (Suc x)

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>\<And>n. m \<le> n \<Longrightarrow> 0 < f n; \<And>n. m \<le> n \<Longrightarrow> 0 \<le> p n; \<And>n. m \<le> n \<Longrightarrow> r * f (Suc n) < p n * f n - p (Suc n) * f (Suc n)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_at_top_linorder
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. 0 < f n \<and> 0 \<le> p n \<and> r * f (Suc n) < p n * f n - p (Suc n) * f (Suc n)

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>\<And>n. m \<le> n \<Longrightarrow> 0 < f n; \<And>n. m \<le> n \<Longrightarrow> 0 \<le> p n; \<And>n. m \<le> n \<Longrightarrow> r * f (Suc n) < p n * f n - p (Suc n) * f (Suc n)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m \<le> ?n \<Longrightarrow> 0 < f ?n
m \<le> ?n \<Longrightarrow> 0 \<le> p ?n
m \<le> ?n \<Longrightarrow> r * f (Suc ?n) < p ?n * f ?n - p (Suc ?n) * f (Suc ?n)

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
let ?c = "(norm (\<Sum>k\<le>m. r * f k) + p m * f m) / r"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
have "Bseq (\<lambda>n. (\<Sum>k\<le>n + Suc m. f k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bseq (\<lambda>n. sum f {..n + Suc m})
[PROOF STEP]
proof (rule BseqI')
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
fix k :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
define n where "n = k + Suc m"
[PROOF STATE]
proof (state)
this:
n = k + Suc m

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
have n: "n > m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < n
[PROOF STEP]
by (simp add: n_def)
[PROOF STATE]
proof (state)
this:
m < n

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
from r
[PROOF STATE]
proof (chain)
picking this:
0 < r
ereal (of_real r) < l
[PROOF STEP]
have "r * norm (\<Sum>k\<le>n. f k) = norm (\<Sum>k\<le>n. r * f k)"
[PROOF STATE]
proof (prove)
using this:
0 < r
ereal (of_real r) < l

goal (1 subgoal):
 1. r * norm (sum f {..n}) = norm (\<Sum>k\<le>n. r * f k)
[PROOF STEP]
by (simp add: sum_distrib_left[symmetric] abs_mult)
[PROOF STATE]
proof (state)
this:
r * norm (sum f {..n}) = norm (\<Sum>k\<le>n. r * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
r * norm (sum f {..n}) = norm (\<Sum>k\<le>n. r * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
m < n
[PROOF STEP]
have "{..n} = {..m} \<union> {Suc m..n}"
[PROOF STATE]
proof (prove)
using this:
m < n

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

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
hence "(\<Sum>k\<le>n. r * f k) = (\<Sum>k\<in>{..m} \<union> {Suc m..n}. r * f k)"
[PROOF STATE]
proof (prove)
using this:
{..n} = {..m} \<union> {Suc m..n}

goal (1 subgoal):
 1. (\<Sum>k\<le>n. r * f k) = (\<Sum>k\<in>{..m} \<union> {Suc m..n}. r * f k)
[PROOF STEP]
by (simp only:)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. r * f k) = (\<Sum>k\<in>{..m} \<union> {Suc m..n}. r * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. r * f k) = (\<Sum>k\<in>{..m} \<union> {Suc m..n}. r * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
have "\<dots> = (\<Sum>k\<le>m. r * f k) + (\<Sum>k=Suc m..n. r * f k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>{..m} \<union> {Suc m..n}. r * f k) = (\<Sum>k\<le>m. r * f k) + (\<Sum>k = Suc m..n. r * f k)
[PROOF STEP]
by (subst sum.union_disjoint) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{..m} \<union> {Suc m..n}. r * f k) = (\<Sum>k\<le>m. r * f k) + (\<Sum>k = Suc m..n. r * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{..m} \<union> {Suc m..n}. r * f k) = (\<Sum>k\<le>m. r * f k) + (\<Sum>k = Suc m..n. r * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
have "norm \<dots> \<le> norm (\<Sum>k\<le>m. r * f k) + norm (\<Sum>k=Suc m..n. r * f k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm ((\<Sum>k\<le>m. r * f k) + (\<Sum>k = Suc m..n. r * f k)) \<le> norm (\<Sum>k\<le>m. r * f k) + norm (\<Sum>k = Suc m..n. r * f k)
[PROOF STEP]
by (rule norm_triangle_ineq)
[PROOF STATE]
proof (state)
this:
norm ((\<Sum>k\<le>m. r * f k) + (\<Sum>k = Suc m..n. r * f k)) \<le> norm (\<Sum>k\<le>m. r * f k) + norm (\<Sum>k = Suc m..n. r * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm ((\<Sum>k\<le>m. r * f k) + (\<Sum>k = Suc m..n. r * f k)) \<le> norm (\<Sum>k\<le>m. r * f k) + norm (\<Sum>k = Suc m..n. r * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
from r less_imp_le[OF m(1)]
[PROOF STATE]
proof (chain)
picking this:
0 < r
ereal (of_real r) < l
m \<le> ?n1 \<Longrightarrow> 0 \<le> f ?n1
[PROOF STEP]
have "(\<Sum>k=Suc m..n. r * f k) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 < r
ereal (of_real r) < l
m \<le> ?n1 \<Longrightarrow> 0 \<le> f ?n1

goal (1 subgoal):
 1. 0 \<le> (\<Sum>k = Suc m..n. r * f k)
[PROOF STEP]
by (intro sum_nonneg) auto
[PROOF STATE]
proof (state)
this:
0 \<le> (\<Sum>k = Suc m..n. r * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
hence "norm (\<Sum>k=Suc m..n. r * f k) = (\<Sum>k=Suc m..n. r * f k)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> (\<Sum>k = Suc m..n. r * f k)

goal (1 subgoal):
 1. norm (\<Sum>k = Suc m..n. r * f k) = (\<Sum>k = Suc m..n. r * f k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (\<Sum>k = Suc m..n. r * f k) = (\<Sum>k = Suc m..n. r * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (\<Sum>k = Suc m..n. r * f k) = (\<Sum>k = Suc m..n. r * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
have "(\<Sum>k=Suc m..n. r * f k) = (\<Sum>k=m..<n. r * f (Suc k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = Suc m..n. r * f k) = (\<Sum>k = m..<n. r * f (Suc k))
[PROOF STEP]
by (subst sum.shift_bounds_Suc_ivl [symmetric])
          (simp only: atLeastLessThanSuc_atLeastAtMost)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = Suc m..n. r * f k) = (\<Sum>k = m..<n. r * f (Suc k))

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = Suc m..n. r * f k) = (\<Sum>k = m..<n. r * f (Suc k))

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
from m
[PROOF STATE]
proof (chain)
picking this:
m \<le> ?n \<Longrightarrow> 0 < f ?n
m \<le> ?n \<Longrightarrow> 0 \<le> p ?n
m \<le> ?n \<Longrightarrow> r * f (Suc ?n) < p ?n * f ?n - p (Suc ?n) * f (Suc ?n)
[PROOF STEP]
have "\<dots> \<le> (\<Sum>k=m..<n. p k * f k - p (Suc k) * f (Suc k))"
[PROOF STATE]
proof (prove)
using this:
m \<le> ?n \<Longrightarrow> 0 < f ?n
m \<le> ?n \<Longrightarrow> 0 \<le> p ?n
m \<le> ?n \<Longrightarrow> r * f (Suc ?n) < p ?n * f ?n - p (Suc ?n) * f (Suc ?n)

goal (1 subgoal):
 1. (\<Sum>k = m..<n. r * f (Suc k)) \<le> (\<Sum>k = m..<n. p k * f k - p (Suc k) * f (Suc k))
[PROOF STEP]
by (intro sum_mono[OF less_imp_le]) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>k = m..<n. r * f (Suc k)) \<le> (\<Sum>k = m..<n. p k * f k - p (Suc k) * f (Suc k))

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = m..<n. r * f (Suc k)) \<le> (\<Sum>k = m..<n. p k * f k - p (Suc k) * f (Suc k))

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
have "\<dots> = -(\<Sum>k=m..<n. p (Suc k) * f (Suc k) - p k * f k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = m..<n. p k * f k - p (Suc k) * f (Suc k)) = - (\<Sum>k = m..<n. p (Suc k) * f (Suc k) - p k * f k)
[PROOF STEP]
by (simp add: sum_negf [symmetric] algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = m..<n. p k * f k - p (Suc k) * f (Suc k)) = - (\<Sum>k = m..<n. p (Suc k) * f (Suc k) - p k * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = m..<n. p k * f k - p (Suc k) * f (Suc k)) = - (\<Sum>k = m..<n. p (Suc k) * f (Suc k) - p k * f k)

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
m < n
[PROOF STEP]
have "\<dots> = p m * f m - p n * f n"
[PROOF STATE]
proof (prove)
using this:
m < n

goal (1 subgoal):
 1. - (\<Sum>k = m..<n. p (Suc k) * f (Suc k) - p k * f k) = p m * f m - p n * f n
[PROOF STEP]
by (cases n, simp, simp only: atLeastLessThanSuc_atLeastAtMost, subst sum_Suc_diff) simp_all
[PROOF STATE]
proof (state)
this:
- (\<Sum>k = m..<n. p (Suc k) * f (Suc k) - p k * f k) = p m * f m - p n * f n

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (\<Sum>k = m..<n. p (Suc k) * f (Suc k) - p k * f k) = p m * f m - p n * f n

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
from less_imp_le[OF m(1)] m(2) n
[PROOF STATE]
proof (chain)
picking this:
m \<le> ?n1 \<Longrightarrow> 0 \<le> f ?n1
m \<le> ?n \<Longrightarrow> 0 \<le> p ?n
m < n
[PROOF STEP]
have "\<dots> \<le> p m * f m"
[PROOF STATE]
proof (prove)
using this:
m \<le> ?n1 \<Longrightarrow> 0 \<le> f ?n1
m \<le> ?n \<Longrightarrow> 0 \<le> p ?n
m < n

goal (1 subgoal):
 1. p m * f m - p n * f n \<le> p m * f m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p m * f m - p n * f n \<le> p m * f m

goal (1 subgoal):
 1. \<And>n. norm (sum f {..n + Suc m}) \<le> ?K
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> norm (\<Sum>k\<le>m. r * f k) + x \<le> norm (\<Sum>k\<le>m. r * f k) + y; \<And>x y. x \<le> y \<Longrightarrow> norm (\<Sum>k\<le>m. r * f k) + x \<le> norm (\<Sum>k\<le>m. r * f k) + y\<rbrakk> \<Longrightarrow> r * norm (sum f {..n}) \<le> norm (\<Sum>k\<le>m. r * f k) + p m * f m
[PROOF STEP]
show "norm (\<Sum>k\<le>n. f k) \<le> (norm (\<Sum>k\<le>m. r * f k) + p m * f m) / r"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> norm (\<Sum>k\<le>m. r * f k) + x \<le> norm (\<Sum>k\<le>m. r * f k) + y; \<And>x y. x \<le> y \<Longrightarrow> norm (\<Sum>k\<le>m. r * f k) + x \<le> norm (\<Sum>k\<le>m. r * f k) + y\<rbrakk> \<Longrightarrow> r * norm (sum f {..n}) \<le> norm (\<Sum>k\<le>m. r * f k) + p m * f m

goal (1 subgoal):
 1. norm (sum f {..n}) \<le> (norm (\<Sum>k\<le>m. r * f k) + p m * f m) / r
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> norm (\<Sum>k\<le>m. r * f k) + x \<le> norm (\<Sum>k\<le>m. r * f k) + y; \<And>x y. x \<le> y \<Longrightarrow> norm (\<Sum>k\<le>m. r * f k) + x \<le> norm (\<Sum>k\<le>m. r * f k) + y\<rbrakk> \<Longrightarrow> r * norm (sum f {..n}) \<le> norm (\<Sum>k\<le>m. r * f k) + p m * f m
0 < r
ereal (of_real r) < l

goal (1 subgoal):
 1. norm (sum f {..n}) \<le> (norm (\<Sum>k\<le>m. r * f k) + p m * f m) / r
[PROOF STEP]
by (subst pos_le_divide_eq[OF r(1)]) (simp only: mult_ac)
[PROOF STATE]
proof (state)
this:
norm (sum f {..n}) \<le> (norm (\<Sum>k\<le>m. r * f k) + p m * f m) / r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Bseq (\<lambda>n. sum f {..n + Suc m})

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Bseq (\<lambda>n. sum f {..n + Suc m})

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
have "(\<Sum>k\<le>n. f k) \<le> (\<Sum>k\<le>n'. f k)" if "Suc m \<le> n" "n \<le> n'" for n n'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..n} \<le> sum f {..n'}
[PROOF STEP]
using less_imp_le[OF m(1)] that
[PROOF STATE]
proof (prove)
using this:
m \<le> ?n1 \<Longrightarrow> 0 \<le> f ?n1
Suc m \<le> n
n \<le> n'

goal (1 subgoal):
 1. sum f {..n} \<le> sum f {..n'}
[PROOF STEP]
by (intro sum_mono2) auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>Suc m \<le> ?n; ?n \<le> ?n'\<rbrakk> \<Longrightarrow> sum f {..?n} \<le> sum f {..?n'}

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Bseq (\<lambda>n. sum f {..n + Suc m})
\<lbrakk>Suc m \<le> ?n; ?n \<le> ?n'\<rbrakk> \<Longrightarrow> sum f {..?n} \<le> sum f {..?n'}
[PROOF STEP]
show "convergent (\<lambda>n. \<Sum>k\<le>n. f k)"
[PROOF STATE]
proof (prove)
using this:
Bseq (\<lambda>n. sum f {..n + Suc m})
\<lbrakk>Suc m \<le> ?n; ?n \<le> ?n'\<rbrakk> \<Longrightarrow> sum f {..?n} \<le> sum f {..?n'}

goal (1 subgoal):
 1. convergent (\<lambda>n. sum f {..n})
[PROOF STEP]
by (rule Bseq_monoseq_convergent'_inc)
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. sum f {..n})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma two_ideal_points:
  assumes "is_poincare_line H"
  shows "card (ideal_points H) = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (ideal_points H) = 2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (ideal_points H) = 2
[PROOF STEP]
have "H \<noteq> unit_circle"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H \<noteq> unit_circle
[PROOF STEP]
using assms not_is_poincare_line_unit_circle
[PROOF STATE]
proof (prove)
using this:
is_poincare_line H
\<not> is_poincare_line unit_circle

goal (1 subgoal):
 1. H \<noteq> unit_circle
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
H \<noteq> unit_circle

goal (1 subgoal):
 1. card (ideal_points H) = 2
[PROOF STEP]
let ?int = "circline_intersection H unit_circle"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (ideal_points H) = 2
[PROOF STEP]
obtain i1 i2 where "i1 \<in> ?int" "i2 \<in> ?int" "i1 \<noteq> i2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i1 i2. \<lbrakk>i1 \<in> circline_intersection H unit_circle; i2 \<in> circline_intersection H unit_circle; i1 \<noteq> i2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using calc_ideal_points_on_circline[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<forall>z\<in>calc_ideal_points H. z \<in> circline_set H

goal (1 subgoal):
 1. (\<And>i1 i2. \<lbrakk>i1 \<in> circline_intersection H unit_circle; i2 \<in> circline_intersection H unit_circle; i1 \<noteq> i2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using calc_ideal_points_on_unit_circle[of H]
[PROOF STATE]
proof (prove)
using this:
\<forall>z\<in>calc_ideal_points H. z \<in> circline_set H
\<forall>z\<in>calc_ideal_points H. z \<in> circline_set unit_circle

goal (1 subgoal):
 1. (\<And>i1 i2. \<lbrakk>i1 \<in> circline_intersection H unit_circle; i2 \<in> circline_intersection H unit_circle; i1 \<noteq> i2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using calc_ideal_points_different[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<forall>z\<in>calc_ideal_points H. z \<in> circline_set H
\<forall>z\<in>calc_ideal_points H. z \<in> circline_set unit_circle
\<exists>i1\<in>calc_ideal_points H. \<exists>i2\<in>calc_ideal_points H. i1 \<noteq> i2

goal (1 subgoal):
 1. (\<And>i1 i2. \<lbrakk>i1 \<in> circline_intersection H unit_circle; i2 \<in> circline_intersection H unit_circle; i1 \<noteq> i2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding circline_intersection_def circline_set_def
[PROOF STATE]
proof (prove)
using this:
\<forall>z\<in>calc_ideal_points H. z \<in> Collect (on_circline H)
\<forall>z\<in>calc_ideal_points H. z \<in> Collect (on_circline unit_circle)
\<exists>i1\<in>calc_ideal_points H. \<exists>i2\<in>calc_ideal_points H. i1 \<noteq> i2

goal (1 subgoal):
 1. (\<And>i1 i2. \<lbrakk>i1 \<in> {z. on_circline H z \<and> on_circline unit_circle z}; i2 \<in> {z. on_circline H z \<and> on_circline unit_circle z}; i1 \<noteq> i2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i1 \<in> circline_intersection H unit_circle
i2 \<in> circline_intersection H unit_circle
i1 \<noteq> i2

goal (1 subgoal):
 1. card (ideal_points H) = 2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i1 \<in> circline_intersection H unit_circle
i2 \<in> circline_intersection H unit_circle
i1 \<noteq> i2

goal (1 subgoal):
 1. card (ideal_points H) = 2
[PROOF STEP]
unfolding ideal_points_def
[PROOF STATE]
proof (prove)
using this:
i1 \<in> circline_intersection H unit_circle
i2 \<in> circline_intersection H unit_circle
i1 \<noteq> i2

goal (1 subgoal):
 1. card (circline_intersection H unit_circle) = 2
[PROOF STEP]
using circline_intersection_at_most_2_points[OF \<open>H \<noteq> unit_circle\<close>]
[PROOF STATE]
proof (prove)
using this:
i1 \<in> circline_intersection H unit_circle
i2 \<in> circline_intersection H unit_circle
i1 \<noteq> i2
finite (circline_intersection H unit_circle) \<and> card (circline_intersection H unit_circle) \<le> 2

goal (1 subgoal):
 1. card (circline_intersection H unit_circle) = 2
[PROOF STEP]
using card_geq_2_iff_contains_2_elems[of ?int]
[PROOF STATE]
proof (prove)
using this:
i1 \<in> circline_intersection H unit_circle
i2 \<in> circline_intersection H unit_circle
i1 \<noteq> i2
finite (circline_intersection H unit_circle) \<and> card (circline_intersection H unit_circle) \<le> 2
(2 \<le> card (circline_intersection H unit_circle)) = (finite (circline_intersection H unit_circle) \<and> (\<exists>x y. x \<noteq> y \<and> x \<in> circline_intersection H unit_circle \<and> y \<in> circline_intersection H unit_circle))

goal (1 subgoal):
 1. card (circline_intersection H unit_circle) = 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (ideal_points H) = 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_octo_of_real_eq_octo_of_real_iff [simp]: "-octo_of_real x = octo_of_real y \<longleftrightarrow> -x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- octo_of_real x = octo_of_real y) = (- x = y)
[PROOF STEP]
using octo_of_real_eq_iff[of "-x" y]
[PROOF STATE]
proof (prove)
using this:
(octo_of_real (- x) = octo_of_real y) = (- x = y)

goal (1 subgoal):
 1. (- octo_of_real x = octo_of_real y) = (- x = y)
[PROOF STEP]
by (simp only: octo_of_real_minus)