[STATEMENT]
lemma real_Gromov_converging_to_boundary:
  fixes u::"nat \<Rightarrow> real"
  shows "Gromov_converging_at_boundary u \<longleftrightarrow> ((u \<longlonglongrightarrow> \<infinity>) \<or> (u \<longlonglongrightarrow> - \<infinity>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_converging_at_boundary u = ((\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gromov_converging_at_boundary u = ((\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>)
[PROOF STEP]
have *: "Gromov_product_at 0 m n \<ge> min m n" for m n::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min m n \<le> Gromov_product_at 0 m n
[PROOF STEP]
unfolding Gromov_product_at_def dist_real_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min m n \<le> (\<bar>0 - m\<bar> + \<bar>0 - n\<bar> - \<bar>m - n\<bar>) / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
min ?m ?n \<le> Gromov_product_at 0 ?m ?n

goal (1 subgoal):
 1. Gromov_converging_at_boundary u = ((\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>)
[PROOF STEP]
have A: "Gromov_converging_at_boundary u" if "u \<longlonglongrightarrow> \<infinity>" for u::"nat \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_converging_at_boundary u
[PROOF STEP]
proof (rule Gromov_converging_at_boundaryI[of 0])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
fix M::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
have "eventually (\<lambda>n. ereal (u n) > M) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ereal M < ereal (u n)
[PROOF STEP]
by (rule order_tendstoD(1)[OF \<open>u \<longlonglongrightarrow> \<infinity>\<close>, of "ereal M"], auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ereal M < ereal (u n)

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. ereal M < ereal (u n)
[PROOF STEP]
obtain N where "\<And>n. n \<ge> N \<Longrightarrow> ereal (u n) > M"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ereal M < ereal (u n)

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> ereal M < ereal (u n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. ereal M < ereal (u n)

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> ereal M < ereal (u n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> ereal M < ereal (u ?n)

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N \<le> ?n \<Longrightarrow> ereal M < ereal (u ?n)
[PROOF STEP]
have A: "u n \<ge> M" if "n \<ge> N" for n
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n \<Longrightarrow> ereal M < ereal (u ?n)

goal (1 subgoal):
 1. M \<le> u n
[PROOF STEP]
by (simp add: less_imp_le that)
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> M \<le> u ?n

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
have "M \<le> Gromov_product_at 0 (u m) (u n)" if "n \<ge> N" "m \<ge> N" for m n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
using A[OF \<open>m \<ge> N\<close>] A[OF \<open>n \<ge> N\<close>] *[of "u m" "u n"]
[PROOF STATE]
proof (prove)
using this:
M \<le> u m
M \<le> u n
min (u m) (u n) \<le> Gromov_product_at 0 (u m) (u n)

goal (1 subgoal):
 1. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>N \<le> ?n; N \<le> ?m\<rbrakk> \<Longrightarrow> M \<le> Gromov_product_at 0 (u ?m) (u ?n)

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>N \<le> ?n; N \<le> ?m\<rbrakk> \<Longrightarrow> M \<le> Gromov_product_at 0 (u ?m) (u ?n)
[PROOF STEP]
show "\<exists>N. \<forall>n \<ge> N. \<forall>m \<ge> N. M \<le> Gromov_product_at 0 (u m) (u n)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>N \<le> ?n; N \<le> ?m\<rbrakk> \<Longrightarrow> M \<le> Gromov_product_at 0 (u ?m) (u ?n)

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (?u x)) \<longlonglongrightarrow> \<infinity> \<Longrightarrow> Gromov_converging_at_boundary ?u

goal (1 subgoal):
 1. Gromov_converging_at_boundary u = ((\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>)
[PROOF STEP]
have *: "Gromov_product_at 0 m n \<ge> - max m n" for m n::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - max m n \<le> Gromov_product_at 0 m n
[PROOF STEP]
unfolding Gromov_product_at_def dist_real_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - max m n \<le> (\<bar>0 - m\<bar> + \<bar>0 - n\<bar> - \<bar>m - n\<bar>) / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- max ?m ?n \<le> Gromov_product_at 0 ?m ?n

goal (1 subgoal):
 1. Gromov_converging_at_boundary u = ((\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>)
[PROOF STEP]
have B: "Gromov_converging_at_boundary u" if "u \<longlonglongrightarrow> -\<infinity>" for u::"nat \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_converging_at_boundary u
[PROOF STEP]
proof (rule Gromov_converging_at_boundaryI[of 0])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
fix M::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
have "eventually (\<lambda>n. ereal (u n) < - M) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ereal (u n) < ereal (- M)
[PROOF STEP]
by (rule order_tendstoD(2)[OF \<open>u \<longlonglongrightarrow> -\<infinity>\<close>, of "ereal (-M)"], auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ereal (u n) < ereal (- M)

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. ereal (u n) < ereal (- M)
[PROOF STEP]
obtain N where "\<And>n. n \<ge> N \<Longrightarrow> ereal (u n) < - M"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ereal (u n) < ereal (- M)

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> ereal (u n) < ereal (- M)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. ereal (u n) < ereal (- M)

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> ereal (u n) < ereal (- M)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> ereal (u ?n) < ereal (- M)

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N \<le> ?n \<Longrightarrow> ereal (u ?n) < ereal (- M)
[PROOF STEP]
have A: "u n \<le> - M" if "n \<ge> N" for n
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n \<Longrightarrow> ereal (u ?n) < ereal (- M)

goal (1 subgoal):
 1. u n \<le> - M
[PROOF STEP]
by (simp add: less_imp_le that)
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> u ?n \<le> - M

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
have "M \<le> Gromov_product_at 0 (u m) (u n)" if "n \<ge> N" "m \<ge> N" for m n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
using A[OF \<open>m \<ge> N\<close>] A[OF \<open>n \<ge> N\<close>] *[of "u m" "u n"]
[PROOF STATE]
proof (prove)
using this:
u m \<le> - M
u n \<le> - M
- max (u m) (u n) \<le> Gromov_product_at 0 (u m) (u n)

goal (1 subgoal):
 1. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>N \<le> ?n; N \<le> ?m\<rbrakk> \<Longrightarrow> M \<le> Gromov_product_at 0 (u ?m) (u ?n)

goal (1 subgoal):
 1. \<And>M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>N \<le> ?n; N \<le> ?m\<rbrakk> \<Longrightarrow> M \<le> Gromov_product_at 0 (u ?m) (u ?n)
[PROOF STEP]
show "\<exists>N. \<forall>n \<ge> N. \<forall>m \<ge> N. M \<le> Gromov_product_at 0 (u m) (u n)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>N \<le> ?n; N \<le> ?m\<rbrakk> \<Longrightarrow> M \<le> Gromov_product_at 0 (u ?m) (u ?n)

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at 0 (u m) (u n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (?u x)) \<longlonglongrightarrow> - \<infinity> \<Longrightarrow> Gromov_converging_at_boundary ?u

goal (1 subgoal):
 1. Gromov_converging_at_boundary u = ((\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>)
[PROOF STEP]
have L: "(u \<longlonglongrightarrow> \<infinity>) \<or> (u \<longlonglongrightarrow> - \<infinity>)" if "Gromov_converging_at_boundary u" for u::"nat \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
have "(\<lambda>n. abs(u n)) \<longlonglongrightarrow> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ereal \<bar>u x\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
using Gromov_converging_at_boundary_imp_unbounded[OF that, of 0]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ereal (dist 0 (u x))) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. (\<lambda>x. ereal \<bar>u x\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
unfolding dist_real_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ereal \<bar>0 - u x\<bar>) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. (\<lambda>x. ereal \<bar>u x\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal \<bar>u x\<bar>) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
obtain r where r: "strict_mono r" "(\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> liminf (\<lambda>n. ereal(u n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; (\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> liminf (\<lambda>n. ereal (u n))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using liminf_subseq_lim[of "\<lambda>n. ereal(u n)"]
[PROOF STATE]
proof (prove)
using this:
\<exists>r. strict_mono r \<and> ((\<lambda>n. ereal (u n)) \<circ> r) \<longlonglongrightarrow> liminf (\<lambda>n. ereal (u n))

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; (\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> liminf (\<lambda>n. ereal (u n))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
using this:
\<exists>r. strict_mono r \<and> (\<lambda>x. ereal (u (r x))) \<longlonglongrightarrow> liminf (\<lambda>n. ereal (u n))

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; (\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> liminf (\<lambda>n. ereal (u n))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
strict_mono r
(\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> liminf (\<lambda>n. ereal (u n))

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
have "(\<lambda>n. abs(ereal (u (r n)))) \<longlonglongrightarrow> abs(liminf (\<lambda>n. ereal(u n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>liminf (\<lambda>n. ereal (u n))\<bar>
[PROOF STEP]
apply (intro tendsto_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> liminf (\<lambda>n. ereal (u n))
[PROOF STEP]
using r(2)
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> liminf (\<lambda>n. ereal (u n))

goal (1 subgoal):
 1. (\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> liminf (\<lambda>n. ereal (u n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>liminf (\<lambda>n. ereal (u n))\<bar>

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>liminf (\<lambda>n. ereal (u n))\<bar>

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
have "(\<lambda>n. abs(ereal (u (r n)))) \<longlonglongrightarrow> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
using \<open>(\<lambda>n. abs(u n)) \<longlonglongrightarrow> \<infinity>\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ereal \<bar>u x\<bar>) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. (\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ereal \<bar>u x\<bar>) \<longlonglongrightarrow> \<infinity> \<Longrightarrow> (\<lambda>n. ereal \<bar>u (r n)\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
using filterlim_compose filterlim_subseq[OF r(1)]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>filterlim ?g ?F3.0 ?F2.0; filterlim ?f ?F2.0 ?F1.0\<rbrakk> \<Longrightarrow> LIM x ?F1.0. ?g (?f x) :> ?F3.0
filterlim r sequentially sequentially

goal (1 subgoal):
 1. (\<lambda>x. ereal \<bar>u x\<bar>) \<longlonglongrightarrow> \<infinity> \<Longrightarrow> (\<lambda>n. ereal \<bar>u (r n)\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>liminf (\<lambda>n. ereal (u n))\<bar>
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
have A: "abs(liminf (\<lambda>n. ereal(u n))) = \<infinity>"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>liminf (\<lambda>n. ereal (u n))\<bar>
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. \<bar>liminf (\<lambda>n. ereal (u n))\<bar> = \<infinity>
[PROOF STEP]
using LIMSEQ_unique
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>liminf (\<lambda>n. ereal (u n))\<bar>
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>
\<lbrakk>?X \<longlonglongrightarrow> ?a; ?X \<longlonglongrightarrow> ?b\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. \<bar>liminf (\<lambda>n. ereal (u n))\<bar> = \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>liminf (\<lambda>n. ereal (u n))\<bar> = \<infinity>

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
obtain r where r: "strict_mono r" "(\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> limsup (\<lambda>n. ereal(u n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; (\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> limsup (\<lambda>n. ereal (u n))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using limsup_subseq_lim[of "\<lambda>n. ereal(u n)"]
[PROOF STATE]
proof (prove)
using this:
\<exists>r. strict_mono r \<and> ((\<lambda>n. ereal (u n)) \<circ> r) \<longlonglongrightarrow> limsup (\<lambda>n. ereal (u n))

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; (\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> limsup (\<lambda>n. ereal (u n))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
using this:
\<exists>r. strict_mono r \<and> (\<lambda>x. ereal (u (r x))) \<longlonglongrightarrow> limsup (\<lambda>n. ereal (u n))

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; (\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> limsup (\<lambda>n. ereal (u n))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
strict_mono r
(\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> limsup (\<lambda>n. ereal (u n))

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
have "(\<lambda>n. abs(ereal (u (r n)))) \<longlonglongrightarrow> abs(limsup (\<lambda>n. ereal(u n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>limsup (\<lambda>n. ereal (u n))\<bar>
[PROOF STEP]
apply (intro tendsto_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> limsup (\<lambda>n. ereal (u n))
[PROOF STEP]
using r(2)
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> limsup (\<lambda>n. ereal (u n))

goal (1 subgoal):
 1. (\<lambda>n. ereal (u (r n))) \<longlonglongrightarrow> limsup (\<lambda>n. ereal (u n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>limsup (\<lambda>n. ereal (u n))\<bar>

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>limsup (\<lambda>n. ereal (u n))\<bar>

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
have "(\<lambda>n. abs(ereal (u (r n)))) \<longlonglongrightarrow> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
using \<open>(\<lambda>n. abs(u n)) \<longlonglongrightarrow> \<infinity>\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ereal \<bar>u x\<bar>) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. (\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ereal \<bar>u x\<bar>) \<longlonglongrightarrow> \<infinity> \<Longrightarrow> (\<lambda>n. ereal \<bar>u (r n)\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
using filterlim_compose filterlim_subseq[OF r(1)]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>filterlim ?g ?F3.0 ?F2.0; filterlim ?f ?F2.0 ?F1.0\<rbrakk> \<Longrightarrow> LIM x ?F1.0. ?g (?f x) :> ?F3.0
filterlim r sequentially sequentially

goal (1 subgoal):
 1. (\<lambda>x. ereal \<bar>u x\<bar>) \<longlonglongrightarrow> \<infinity> \<Longrightarrow> (\<lambda>n. ereal \<bar>u (r n)\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>limsup (\<lambda>n. ereal (u n))\<bar>
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>
[PROOF STEP]
have B: "abs(limsup (\<lambda>n. ereal(u n))) = \<infinity>"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>limsup (\<lambda>n. ereal (u n))\<bar>
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>

goal (1 subgoal):
 1. \<bar>limsup (\<lambda>n. ereal (u n))\<bar> = \<infinity>
[PROOF STEP]
using LIMSEQ_unique
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<bar>limsup (\<lambda>n. ereal (u n))\<bar>
(\<lambda>n. \<bar>ereal (u (r n))\<bar>) \<longlonglongrightarrow> \<infinity>
\<lbrakk>?X \<longlonglongrightarrow> ?a; ?X \<longlonglongrightarrow> ?b\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. \<bar>limsup (\<lambda>n. ereal (u n))\<bar> = \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>limsup (\<lambda>n. ereal (u n))\<bar> = \<infinity>

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
have "\<not>(liminf u = - \<infinity> \<and> limsup u = \<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (liminf (\<lambda>x. ereal (u x)) = - \<infinity> \<and> limsup (\<lambda>x. ereal (u x)) = \<infinity>)
[PROOF STEP]
proof (rule ccontr, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>liminf (\<lambda>x. ereal (u x)) = - \<infinity>; limsup (\<lambda>x. ereal (u x)) = \<infinity>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "liminf u = -\<infinity>" "limsup u = \<infinity>"
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>x. ereal (u x)) = - \<infinity>
limsup (\<lambda>x. ereal (u x)) = \<infinity>

goal (1 subgoal):
 1. \<lbrakk>liminf (\<lambda>x. ereal (u x)) = - \<infinity>; limsup (\<lambda>x. ereal (u x)) = \<infinity>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "\<exists>N. \<forall>n \<ge> N. \<forall>m \<ge> N. Gromov_product_at 0 (u m) (u n) \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. 1 \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
Gromov_converging_at_boundary u

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. 1 \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
unfolding Gromov_converging_at_boundary_def
[PROOF STATE]
proof (prove)
using this:
\<forall>a M. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. M \<le> Gromov_product_at a (u m) (u n)

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. 1 \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. 1 \<le> Gromov_product_at 0 (u m) (u n)

goal (1 subgoal):
 1. \<lbrakk>liminf (\<lambda>x. ereal (u x)) = - \<infinity>; limsup (\<lambda>x. ereal (u x)) = \<infinity>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. 1 \<le> Gromov_product_at 0 (u m) (u n)
[PROOF STEP]
obtain N where N: "\<And>m n. m \<ge> N \<Longrightarrow> n \<ge> N \<Longrightarrow> Gromov_product_at 0 (u m) (u n) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. \<forall>m\<ge>N. 1 \<le> Gromov_product_at 0 (u m) (u n)

goal (1 subgoal):
 1. (\<And>N. (\<And>m n. \<lbrakk>N \<le> m; N \<le> n\<rbrakk> \<Longrightarrow> 1 \<le> Gromov_product_at 0 (u m) (u n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>N \<le> ?m; N \<le> ?n\<rbrakk> \<Longrightarrow> 1 \<le> Gromov_product_at 0 (u ?m) (u ?n)

goal (1 subgoal):
 1. \<lbrakk>liminf (\<lambda>x. ereal (u x)) = - \<infinity>; limsup (\<lambda>x. ereal (u x)) = \<infinity>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "\<exists>n \<ge> N. ereal(u n) > ereal 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n\<ge>N. ereal 0 < ereal (u n)
[PROOF STEP]
apply (rule limsup_obtain)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal 0 < limsup (\<lambda>n. ereal (u n))
[PROOF STEP]
unfolding \<open>limsup u = \<infinity>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal 0 < \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>n\<ge>N. ereal 0 < ereal (u n)

goal (1 subgoal):
 1. \<lbrakk>liminf (\<lambda>x. ereal (u x)) = - \<infinity>; limsup (\<lambda>x. ereal (u x)) = \<infinity>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>n\<ge>N. ereal 0 < ereal (u n)
[PROOF STEP]
obtain n where n: "n \<ge> N" "u n > 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>n\<ge>N. ereal 0 < ereal (u n)

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>N \<le> n; 0 < u n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N \<le> n
0 < u n

goal (1 subgoal):
 1. \<lbrakk>liminf (\<lambda>x. ereal (u x)) = - \<infinity>; limsup (\<lambda>x. ereal (u x)) = \<infinity>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "\<exists>n \<ge> N. ereal(u n) < ereal 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n\<ge>N. ereal (u n) < ereal 0
[PROOF STEP]
apply (rule liminf_obtain)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>n. ereal (u n)) < ereal 0
[PROOF STEP]
unfolding \<open>liminf u = -\<infinity>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<infinity> < ereal 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>n\<ge>N. ereal (u n) < ereal 0

goal (1 subgoal):
 1. \<lbrakk>liminf (\<lambda>x. ereal (u x)) = - \<infinity>; limsup (\<lambda>x. ereal (u x)) = \<infinity>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>n\<ge>N. ereal (u n) < ereal 0
[PROOF STEP]
obtain m where m: "m \<ge> N" "u m < 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>n\<ge>N. ereal (u n) < ereal 0

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>N \<le> m; u m < 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N \<le> m
u m < 0

goal (1 subgoal):
 1. \<lbrakk>liminf (\<lambda>x. ereal (u x)) = - \<infinity>; limsup (\<lambda>x. ereal (u x)) = \<infinity>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "Gromov_product_at 0 (u m) (u n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_product_at 0 (u m) (u n) = 0
[PROOF STEP]
unfolding Gromov_product_at_def dist_real_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>0 - u m\<bar> + \<bar>0 - u n\<bar> - \<bar>u m - u n\<bar>) / 2 = 0
[PROOF STEP]
using m n
[PROOF STATE]
proof (prove)
using this:
N \<le> m
u m < 0
N \<le> n
0 < u n

goal (1 subgoal):
 1. (\<bar>0 - u m\<bar> + \<bar>0 - u n\<bar> - \<bar>u m - u n\<bar>) / 2 = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_product_at 0 (u m) (u n) = 0

goal (1 subgoal):
 1. \<lbrakk>liminf (\<lambda>x. ereal (u x)) = - \<infinity>; limsup (\<lambda>x. ereal (u x)) = \<infinity>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Gromov_product_at 0 (u m) (u n) = 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
Gromov_product_at 0 (u m) (u n) = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
using N[OF m(1) n(1)]
[PROOF STATE]
proof (prove)
using this:
Gromov_product_at 0 (u m) (u n) = 0
1 \<le> Gromov_product_at 0 (u m) (u n)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> (liminf (\<lambda>x. ereal (u x)) = - \<infinity> \<and> limsup (\<lambda>x. ereal (u x)) = \<infinity>)

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (liminf (\<lambda>x. ereal (u x)) = - \<infinity> \<and> limsup (\<lambda>x. ereal (u x)) = \<infinity>)
[PROOF STEP]
have "liminf u = \<infinity> \<or> limsup u = - \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<not> (liminf (\<lambda>x. ereal (u x)) = - \<infinity> \<and> limsup (\<lambda>x. ereal (u x)) = \<infinity>)

goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (u x)) = \<infinity> \<or> limsup (\<lambda>x. ereal (u x)) = - \<infinity>
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
\<not> (liminf (\<lambda>x. ereal (u x)) = - \<infinity> \<and> limsup (\<lambda>x. ereal (u x)) = \<infinity>)
\<bar>liminf (\<lambda>n. ereal (u n))\<bar> = \<infinity>
\<bar>limsup (\<lambda>n. ereal (u n))\<bar> = \<infinity>

goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (u x)) = \<infinity> \<or> limsup (\<lambda>x. ereal (u x)) = - \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>x. ereal (u x)) = \<infinity> \<or> limsup (\<lambda>x. ereal (u x)) = - \<infinity>

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
liminf (\<lambda>x. ereal (u x)) = \<infinity> \<or> limsup (\<lambda>x. ereal (u x)) = - \<infinity>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
liminf (\<lambda>x. ereal (u x)) = \<infinity> \<or> limsup (\<lambda>x. ereal (u x)) = - \<infinity>

goal (1 subgoal):
 1. (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>
[PROOF STEP]
by (simp add: Liminf_PInfty Limsup_MInfty)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Gromov_converging_at_boundary ?u \<Longrightarrow> (\<lambda>x. ereal (?u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (?u x)) \<longlonglongrightarrow> - \<infinity>

goal (1 subgoal):
 1. Gromov_converging_at_boundary u = ((\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_converging_at_boundary u = ((\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>)
[PROOF STEP]
using L A B
[PROOF STATE]
proof (prove)
using this:
Gromov_converging_at_boundary ?u \<Longrightarrow> (\<lambda>x. ereal (?u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (?u x)) \<longlonglongrightarrow> - \<infinity>
(\<lambda>x. ereal (?u x)) \<longlonglongrightarrow> \<infinity> \<Longrightarrow> Gromov_converging_at_boundary ?u
(\<lambda>x. ereal (?u x)) \<longlonglongrightarrow> - \<infinity> \<Longrightarrow> Gromov_converging_at_boundary ?u

goal (1 subgoal):
 1. Gromov_converging_at_boundary u = ((\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gromov_converging_at_boundary u = ((\<lambda>x. ereal (u x)) \<longlonglongrightarrow> \<infinity> \<or> (\<lambda>x. ereal (u x)) \<longlonglongrightarrow> - \<infinity>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma landau_symbol_ge_3_cong:
  assumes "landau_symbol L L' Lr"
  assumes "\<And>x::'a::linordered_semidom. x \<ge> 3 \<Longrightarrow> f x = g x"
  shows   "L at_top (f) = L at_top (g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L at_top f = L at_top g
[PROOF STEP]
apply (rule landau_symbol.cong[OF assms(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x = g x
[PROOF STEP]
apply (subst eventually_at_top_linorder, rule exI[of _ 3], simp add: assms(2))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma elementLevelPrefixElement:
  assumes "e \<in> set (elements (prefixToLevel level M))"
  shows "elementLevel e (prefixToLevel level M) = elementLevel e M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elementLevel e (prefixToLevel level M) = elementLevel e M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
e \<in> set (elements (prefixToLevel level M))

goal (1 subgoal):
 1. elementLevel e (prefixToLevel level M) = elementLevel e M
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. e \<in> set (elements (prefixToLevel level M)) \<Longrightarrow> elementLevel e (prefixToLevel level M) = elementLevel e M
[PROOF STEP]
have "isPrefix (prefixToLevel level M) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isPrefix (prefixToLevel level M) M
[PROOF STEP]
by (simp add: isPrefixPrefixToLevel)
[PROOF STATE]
proof (state)
this:
isPrefix (prefixToLevel level M) M

goal (1 subgoal):
 1. e \<in> set (elements (prefixToLevel level M)) \<Longrightarrow> elementLevel e (prefixToLevel level M) = elementLevel e M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isPrefix (prefixToLevel level M) M
[PROOF STEP]
obtain s where "(prefixToLevel level M) @ s = M"
[PROOF STATE]
proof (prove)
using this:
isPrefix (prefixToLevel level M) M

goal (1 subgoal):
 1. (\<And>s. prefixToLevel level M @ s = M \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding isPrefix_def
[PROOF STATE]
proof (prove)
using this:
\<exists>s. prefixToLevel level M @ s = M

goal (1 subgoal):
 1. (\<And>s. prefixToLevel level M @ s = M \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prefixToLevel level M @ s = M

goal (1 subgoal):
 1. e \<in> set (elements (prefixToLevel level M)) \<Longrightarrow> elementLevel e (prefixToLevel level M) = elementLevel e M
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
e \<in> set (elements (prefixToLevel level M))
prefixToLevel level M @ s = M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
e \<in> set (elements (prefixToLevel level M))
prefixToLevel level M @ s = M

goal (1 subgoal):
 1. elementLevel e (prefixToLevel level M) = elementLevel e M
[PROOF STEP]
using elementLevelAppend[of "e" "prefixToLevel level M" "s"]
[PROOF STATE]
proof (prove)
using this:
e \<in> set (elements (prefixToLevel level M))
prefixToLevel level M @ s = M
e \<in> set (elements (prefixToLevel level M)) \<Longrightarrow> elementLevel e (prefixToLevel level M) = elementLevel e (prefixToLevel level M @ s)

goal (1 subgoal):
 1. elementLevel e (prefixToLevel level M) = elementLevel e M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
elementLevel e (prefixToLevel level M) = elementLevel e M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invariant_1_degree_0:
  assumes inv: "invariant_1 rai"
  shows "degree (poly_real_alg_1 rai) \<noteq> 0" (is "degree ?p \<noteq> 0")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_real_alg_1 rai) \<noteq> 0
[PROOF STEP]
proof (rule notI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (poly_real_alg_1 rai) = 0 \<Longrightarrow> False
[PROOF STEP]
assume deg: "degree ?p = 0"
[PROOF STATE]
proof (state)
this:
degree (poly_real_alg_1 rai) = 0

goal (1 subgoal):
 1. degree (poly_real_alg_1 rai) = 0 \<Longrightarrow> False
[PROOF STEP]
from inv
[PROOF STATE]
proof (chain)
picking this:
invariant_1 rai
[PROOF STEP]
have "ipoly ?p (real_of_1 rai) = 0"
[PROOF STATE]
proof (prove)
using this:
invariant_1 rai

goal (1 subgoal):
 1. poly (real_of_int_poly (poly_real_alg_1 rai)) (real_of_1 rai) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly (real_of_int_poly (poly_real_alg_1 rai)) (real_of_1 rai) = 0

goal (1 subgoal):
 1. degree (poly_real_alg_1 rai) = 0 \<Longrightarrow> False
[PROOF STEP]
with deg
[PROOF STATE]
proof (chain)
picking this:
degree (poly_real_alg_1 rai) = 0
poly (real_of_int_poly (poly_real_alg_1 rai)) (real_of_1 rai) = 0
[PROOF STEP]
have "?p = 0"
[PROOF STATE]
proof (prove)
using this:
degree (poly_real_alg_1 rai) = 0
poly (real_of_int_poly (poly_real_alg_1 rai)) (real_of_1 rai) = 0

goal (1 subgoal):
 1. poly_real_alg_1 rai = 0
[PROOF STEP]
by (meson less_Suc0 representsI represents_degree)
[PROOF STATE]
proof (state)
this:
poly_real_alg_1 rai = 0

goal (1 subgoal):
 1. degree (poly_real_alg_1 rai) = 0 \<Longrightarrow> False
[PROOF STEP]
with inv
[PROOF STATE]
proof (chain)
picking this:
invariant_1 rai
poly_real_alg_1 rai = 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
invariant_1 rai
poly_real_alg_1 rai = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma domains_comp:
    assumes "seq g f"
    shows "domains (g \<cdot> f) = domains f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domains (g \<cdot> f) = domains f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. domains (g \<cdot> f) = domains f
[PROOF STEP]
have "domains (g \<cdot> f) = {a. ide a \<and> seq (g \<cdot> f) a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domains (g \<cdot> f) = {a. ide a \<and> seq (g \<cdot> f) a}
[PROOF STEP]
using domains_def ext
[PROOF STATE]
proof (prove)
using this:
domains ?f \<equiv> {a. ide a \<and> ?f \<cdot> a \<noteq> null}
?g \<cdot> ?f \<noteq> null \<Longrightarrow> seq ?g ?f

goal (1 subgoal):
 1. domains (g \<cdot> f) = {a. ide a \<and> seq (g \<cdot> f) a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domains (g \<cdot> f) = {a. ide a \<and> seq (g \<cdot> f) a}

goal (1 subgoal):
 1. domains (g \<cdot> f) = domains f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
domains (g \<cdot> f) = {a. ide a \<and> seq (g \<cdot> f) a}

goal (1 subgoal):
 1. domains (g \<cdot> f) = domains f
[PROOF STEP]
have "... = {a. ide a \<and> seq f a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a. ide a \<and> seq (g \<cdot> f) a} = {a. ide a \<and> seq f a}
[PROOF STEP]
using assms ide_def match_1 match_3
[PROOF STATE]
proof (prove)
using this:
seq g f
ide ?a \<equiv> ?a \<cdot> ?a \<noteq> null \<and> (\<forall>f. (f \<cdot> ?a \<noteq> null \<longrightarrow> f \<cdot> ?a = f) \<and> (?a \<cdot> f \<noteq> null \<longrightarrow> ?a \<cdot> f = f))
\<lbrakk>seq ?h ?g; seq (?h \<cdot> ?g) ?f\<rbrakk> \<Longrightarrow> seq ?g ?f
\<lbrakk>seq ?g ?f; seq ?h ?g\<rbrakk> \<Longrightarrow> seq (?h \<cdot> ?g) ?f

goal (1 subgoal):
 1. {a. ide a \<and> seq (g \<cdot> f) a} = {a. ide a \<and> seq f a}
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
{a. ide a \<and> seq (g \<cdot> f) a} = {a. ide a \<and> seq f a}

goal (1 subgoal):
 1. domains (g \<cdot> f) = domains f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{a. ide a \<and> seq (g \<cdot> f) a} = {a. ide a \<and> seq f a}

goal (1 subgoal):
 1. domains (g \<cdot> f) = domains f
[PROOF STEP]
have "... = domains f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a. ide a \<and> seq f a} = domains f
[PROOF STEP]
using domains_def ext
[PROOF STATE]
proof (prove)
using this:
domains ?f \<equiv> {a. ide a \<and> ?f \<cdot> a \<noteq> null}
?g \<cdot> ?f \<noteq> null \<Longrightarrow> seq ?g ?f

goal (1 subgoal):
 1. {a. ide a \<and> seq f a} = domains f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a. ide a \<and> seq f a} = domains f

goal (1 subgoal):
 1. domains (g \<cdot> f) = domains f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
domains (g \<cdot> f) = domains f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domains (g \<cdot> f) = domains f

goal (1 subgoal):
 1. domains (g \<cdot> f) = domains f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
domains (g \<cdot> f) = domains f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonzero_positions_combine_infmatrix[simp]: "f 0 0 = 0 \<Longrightarrow> nonzero_positions (combine_infmatrix f A B) \<subseteq> (nonzero_positions A) \<union> (nonzero_positions B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (0::'b) (0::'c) = (0::'a) \<Longrightarrow> nonzero_positions (combine_infmatrix f A B) \<subseteq> nonzero_positions A \<union> nonzero_positions B
[PROOF STEP]
by (rule subsetI, simp add: nonzero_positions_def combine_infmatrix_def, auto)


[STATEMENT]
lemma two_power_fact_le_fact:
  assumes "n \<ge> 1"
  shows   "2^k * fact n \<le> (fact (n + k) :: 'a :: {semiring_char_0,linordered_semidom})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) ^ k * fact n \<le> fact (n + k)
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (2::'a) ^ 0 * fact n \<le> fact (n + 0)
 2. \<And>k. (2::'a) ^ k * fact n \<le> fact (n + k) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
(2::'a) ^ k * fact n \<le> fact (n + k)

goal (2 subgoals):
 1. (2::'a) ^ 0 * fact n \<le> fact (n + 0)
 2. \<And>k. (2::'a) ^ k * fact n \<le> fact (n + k) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
have "2 ^ Suc k * fact n = 2 * (2 ^ k * fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'b) ^ Suc k * fact n = (2::'b) * ((2::'b) ^ k * fact n)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(2::?'b1) ^ Suc k * fact n = (2::?'b1) * ((2::?'b1) ^ k * fact n)

goal (2 subgoals):
 1. (2::'a) ^ 0 * fact n \<le> fact (n + 0)
 2. \<And>k. (2::'a) ^ k * fact n \<le> fact (n + k) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2::?'b1) ^ Suc k * fact n = (2::?'b1) * ((2::?'b1) ^ k * fact n)

goal (2 subgoals):
 1. (2::'a) ^ 0 * fact n \<le> fact (n + 0)
 2. \<And>k. (2::'a) ^ k * fact n \<le> fact (n + k) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
note Suc.IH
[PROOF STATE]
proof (state)
this:
(2::'a) ^ k * fact n \<le> fact (n + k)

goal (2 subgoals):
 1. (2::'a) ^ 0 * fact n \<le> fact (n + 0)
 2. \<And>k. (2::'a) ^ k * fact n \<le> fact (n + k) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2::'a) ^ k * fact n \<le> fact (n + k)

goal (2 subgoals):
 1. (2::'a) ^ 0 * fact n \<le> fact (n + 0)
 2. \<And>k. (2::'a) ^ k * fact n \<le> fact (n + k) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 \<le> n
[PROOF STEP]
have "of_nat 1 + of_nat 1 \<le> of_nat n + (of_nat (Suc k) :: 'a)"
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. of_nat 1 + of_nat 1 \<le> of_nat n + of_nat (Suc k)
[PROOF STEP]
by (intro add_mono) (unfold of_nat_le_iff, simp_all)
[PROOF STATE]
proof (state)
this:
of_nat 1 + of_nat 1 \<le> of_nat n + of_nat (Suc k)

goal (2 subgoals):
 1. (2::'a) ^ 0 * fact n \<le> fact (n + 0)
 2. \<And>k. (2::'a) ^ k * fact n \<le> fact (n + k) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
hence "2 * (fact (n + k) :: 'a) \<le> of_nat (n + Suc k) * fact (n + k)"
[PROOF STATE]
proof (prove)
using this:
of_nat 1 + of_nat 1 \<le> of_nat n + of_nat (Suc k)

goal (1 subgoal):
 1. (2::'a) * fact (n + k) \<le> of_nat (n + Suc k) * fact (n + k)
[PROOF STEP]
by (intro mult_right_mono) (simp_all add: add_ac)
[PROOF STATE]
proof (state)
this:
(2::'a) * fact (n + k) \<le> of_nat (n + Suc k) * fact (n + k)

goal (2 subgoals):
 1. (2::'a) ^ 0 * fact n \<le> fact (n + 0)
 2. \<And>k. (2::'a) ^ k * fact n \<le> fact (n + k) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2::'a) * fact (n + k) \<le> of_nat (n + Suc k) * fact (n + k)

goal (2 subgoals):
 1. (2::'a) ^ 0 * fact n \<le> fact (n + 0)
 2. \<And>k. (2::'a) ^ k * fact n \<le> fact (n + k) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
have "\<dots> = fact (n + Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (n + Suc k) * fact (n + k) = fact (n + Suc k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_nat (n + Suc k) * fact (n + k) = fact (n + Suc k)

goal (2 subgoals):
 1. (2::'a) ^ 0 * fact n \<le> fact (n + 0)
 2. \<And>k. (2::'a) ^ k * fact n \<le> fact (n + k) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> (2::'a) * x \<le> (2::'a) * y) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> (2::'a) * x \<le> (2::'a) * y) \<Longrightarrow> (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)

goal (1 subgoal):
 1. (2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)
[PROOF STEP]
by - (simp add: mult_left_mono)
[PROOF STATE]
proof (state)
this:
(2::'a) ^ Suc k * fact n \<le> fact (n + Suc k)

goal (1 subgoal):
 1. (2::'a) ^ 0 * fact n \<le> fact (n + 0)
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma empty_graph_is_tree :
  assumes "edges g = {}"
  shows   "is_tree g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tree g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
edges g = {}

goal (1 subgoal):
 1. is_tree g
[PROOF STEP]
by (auto simp add : is_tree_def subpath_def vertices_def)


[STATEMENT]
lemma hypnat_le_add_diff_inverse [simp]: "\<And>m n::hypnat. n \<le> m \<Longrightarrow> n + (m - n) = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. n \<le> m \<Longrightarrow> n + (m - n) = m
[PROOF STEP]
by transfer (rule le_add_diff_inverse)


[STATEMENT]
lemma degree_poly_mult_rat[simp]: assumes "r \<noteq> 0" shows "degree (poly_mult_rat r p) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_mult_rat r p) = degree p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (poly_mult_rat r p) = degree p
[PROOF STEP]
obtain n d where quot: "quotient_of r = (n,d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n d. quotient_of r = (n, d) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
quotient_of r = (n, d)

goal (1 subgoal):
 1. degree (poly_mult_rat r p) = degree p
[PROOF STEP]
from quotient_of_div[OF quot]
[PROOF STATE]
proof (chain)
picking this:
r = rat_of_int n / rat_of_int d
[PROOF STEP]
have r: "r = of_int n / of_int d"
[PROOF STATE]
proof (prove)
using this:
r = rat_of_int n / rat_of_int d

goal (1 subgoal):
 1. r = rat_of_int n / rat_of_int d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r = rat_of_int n / rat_of_int d

goal (1 subgoal):
 1. degree (poly_mult_rat r p) = degree p
[PROOF STEP]
from quotient_of_denom_pos[OF quot]
[PROOF STATE]
proof (chain)
picking this:
0 < d
[PROOF STEP]
have d: "d \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < d

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

goal (1 subgoal):
 1. degree (poly_mult_rat r p) = degree p
[PROOF STEP]
with assms r
[PROOF STATE]
proof (chain)
picking this:
r \<noteq> 0
r = rat_of_int n / rat_of_int d
d \<noteq> 0
[PROOF STEP]
have n0: "n \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0
r = rat_of_int n / rat_of_int d
d \<noteq> 0

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

goal (1 subgoal):
 1. degree (poly_mult_rat r p) = degree p
[PROOF STEP]
from quot
[PROOF STATE]
proof (chain)
picking this:
quotient_of r = (n, d)
[PROOF STEP]
have id: "poly_mult_rat r p = poly_mult_rat_main n d p"
[PROOF STATE]
proof (prove)
using this:
quotient_of r = (n, d)

goal (1 subgoal):
 1. poly_mult_rat r p = poly_mult_rat_main n d p
[PROOF STEP]
unfolding poly_mult_rat_def
[PROOF STATE]
proof (prove)
using this:
quotient_of r = (n, d)

goal (1 subgoal):
 1. (case quotient_of r of (n, d) \<Rightarrow> poly_mult_rat_main n d p) = poly_mult_rat_main n d p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly_mult_rat r p = poly_mult_rat_main n d p

goal (1 subgoal):
 1. degree (poly_mult_rat r p) = degree p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_mult_rat r p) = degree p
[PROOF STEP]
unfolding id degree_poly_mult_rat_main[OF n0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if d = 0 then 0 else degree p) = degree p
[PROOF STEP]
using d
[PROOF STATE]
proof (prove)
using this:
d \<noteq> 0

goal (1 subgoal):
 1. (if d = 0 then 0 else degree p) = degree p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (poly_mult_rat r p) = degree p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_exist_split:
  fixes r :: real
  assumes "0 < r" and "summable f"
  shows "\<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r
[PROOF STEP]
from LIMSEQ_D[OF summable_LIMSEQ[OF \<open>summable f\<close>] \<open>0 < r\<close>]
[PROOF STATE]
proof (chain)
picking this:
\<exists>no. \<forall>n\<ge>no. norm (sum f {..<n} - suminf f) < r
[PROOF STEP]
obtain N :: nat where "\<forall> n \<ge> N. norm (sum f {..<n} - suminf f) < r"
[PROOF STATE]
proof (prove)
using this:
\<exists>no. \<forall>n\<ge>no. norm (sum f {..<n} - suminf f) < r

goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. norm (sum f {..<n} - suminf f) < r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>N. norm (sum f {..<n} - suminf f) < r

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n\<ge>N. norm (sum f {..<n} - suminf f) < r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>N. norm (sum f {..<n} - suminf f) < r

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r
[PROOF STEP]
by (auto simp: norm_minus_commute suminf_minus_initial_segment[OF \<open>summable f\<close>])
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reduced_run_length:
      assumes "reduced_run q v\<^sub>1 v\<^sub>2 l w w\<^sub>1 w\<^sub>2 u"
      shows "length v\<^sub>1 \<le> length w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length v\<^sub>1 \<le> length w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length v\<^sub>1 \<le> length w
[PROOF STEP]
have "length v\<^sub>1 \<le> length w\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length v\<^sub>1 \<le> length w\<^sub>1
[PROOF STEP]
using reduced_run_length_1 assms
[PROOF STATE]
proof (prove)
using this:
reduced_run ?q ?v\<^sub>1 ?v\<^sub>2 ?l ?w ?w\<^sub>1 ?w\<^sub>2 ?u \<Longrightarrow> length ?v\<^sub>1 \<le> length ?w\<^sub>1
reduced_run q v\<^sub>1 v\<^sub>2 l w w\<^sub>1 w\<^sub>2 u

goal (1 subgoal):
 1. length v\<^sub>1 \<le> length w\<^sub>1
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
length v\<^sub>1 \<le> length w\<^sub>1

goal (1 subgoal):
 1. length v\<^sub>1 \<le> length w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length v\<^sub>1 \<le> length w\<^sub>1

goal (1 subgoal):
 1. length v\<^sub>1 \<le> length w
[PROOF STEP]
have "\<dots> \<le> length w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length w\<^sub>1 \<le> length w
[PROOF STEP]
using reduced_run_decompose assms
[PROOF STATE]
proof (prove)
using this:
reduced_run ?q ?v\<^sub>1 ?v\<^sub>2 ?l ?w ?w\<^sub>1 ?w\<^sub>2 ?u \<Longrightarrow> ?w =\<^sub>F ?w\<^sub>1 @ ?w\<^sub>2
reduced_run q v\<^sub>1 v\<^sub>2 l w w\<^sub>1 w\<^sub>2 u

goal (1 subgoal):
 1. length w\<^sub>1 \<le> length w
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
length w\<^sub>1 \<le> length w

goal (1 subgoal):
 1. length v\<^sub>1 \<le> length w
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
length v\<^sub>1 \<le> length w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length v\<^sub>1 \<le> length w

goal (1 subgoal):
 1. length v\<^sub>1 \<le> length w
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
length v\<^sub>1 \<le> length w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma parallel_subspace_aux:
  assumes "subspace A"
    and "subspace B"
    and "affine_parallel A B"
  shows "A \<supseteq> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
subspace A
subspace B
affine_parallel A B
[PROOF STEP]
obtain a where a: "\<forall>x. x \<in> A \<longleftrightarrow> a + x \<in> B"
[PROOF STATE]
proof (prove)
using this:
subspace A
subspace B
affine_parallel A B

goal (1 subgoal):
 1. (\<And>a. \<forall>x. (x \<in> A) = (a + x \<in> B) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using affine_parallel_expl[of A B]
[PROOF STATE]
proof (prove)
using this:
subspace A
subspace B
affine_parallel A B
affine_parallel A B = (\<exists>a. \<forall>x. (x \<in> A) = (a + x \<in> B))

goal (1 subgoal):
 1. (\<And>a. \<forall>x. (x \<in> A) = (a + x \<in> B) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x. (x \<in> A) = (a + x \<in> B)

goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. (x \<in> A) = (a + x \<in> B)
[PROOF STEP]
have "-a \<in> A"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. (x \<in> A) = (a + x \<in> B)

goal (1 subgoal):
 1. - a \<in> A
[PROOF STEP]
using assms subspace_0[of B]
[PROOF STATE]
proof (prove)
using this:
\<forall>x. (x \<in> A) = (a + x \<in> B)
subspace A
subspace B
affine_parallel A B
subspace B \<Longrightarrow> (0::'a) \<in> B

goal (1 subgoal):
 1. - a \<in> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- a \<in> A

goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- a \<in> A
[PROOF STEP]
have "a \<in> A"
[PROOF STATE]
proof (prove)
using this:
- a \<in> A

goal (1 subgoal):
 1. a \<in> A
[PROOF STEP]
using assms subspace_neg[of A "-a"]
[PROOF STATE]
proof (prove)
using this:
- a \<in> A
subspace A
subspace B
affine_parallel A B
\<lbrakk>subspace A; - a \<in> A\<rbrakk> \<Longrightarrow> - (- a) \<in> A

goal (1 subgoal):
 1. a \<in> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> A

goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> A

goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
using assms a
[PROOF STATE]
proof (prove)
using this:
a \<in> A
subspace A
subspace B
affine_parallel A B
\<forall>x. (x \<in> A) = (a + x \<in> B)

goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
unfolding subspace_def
[PROOF STATE]
proof (prove)
using this:
a \<in> A
(0::'a) \<in> A \<and> (\<forall>x\<in>A. \<forall>y\<in>A. x + y \<in> A) \<and> (\<forall>c. \<forall>x\<in>A. c *\<^sub>R x \<in> A)
(0::'a) \<in> B \<and> (\<forall>x\<in>B. \<forall>y\<in>B. x + y \<in> B) \<and> (\<forall>c. \<forall>x\<in>B. c *\<^sub>R x \<in> B)
affine_parallel A B
\<forall>x. (x \<in> A) = (a + x \<in> B)

goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<subseteq> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_mod_dim[simp]: "dim_row (mat_mod M) = dim_row M" "dim_col (mat_mod M) = dim_col M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (local.mat_mod M) = dim_row M &&& dim_col (local.mat_mod M) = dim_col M
[PROOF STEP]
using mat_mod_def
[PROOF STATE]
proof (prove)
using this:
local.mat_mod ?M \<equiv> map_mat (\<lambda>x. x mod m) ?M

goal (1 subgoal):
 1. dim_row (local.mat_mod M) = dim_row M &&& dim_col (local.mat_mod M) = dim_col M
[PROOF STEP]
by simp_all


[STATEMENT]
lemma scalar_product_eq0: "\<forall>c\<in>set ns. c = 0 \<Longrightarrow> scalar_product ns is = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>c\<in>set ns. c = 0 \<Longrightarrow> scalar_product ns is = 0
[PROOF STEP]
proof (induct "is" arbitrary: "ns")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ns. \<forall>c\<in>set ns. c = 0 \<Longrightarrow> scalar_product ns [] = 0
 2. \<And>a is ns. \<lbrakk>\<And>ns. \<forall>c\<in>set ns. c = 0 \<Longrightarrow> scalar_product ns is = 0; \<forall>c\<in>set ns. c = 0\<rbrakk> \<Longrightarrow> scalar_product ns (a # is) = 0
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
\<forall>c\<in>set ?ns. c = 0 \<Longrightarrow> scalar_product ?ns is_ = 0
\<forall>c\<in>set ns. c = 0

goal (2 subgoals):
 1. \<And>ns. \<forall>c\<in>set ns. c = 0 \<Longrightarrow> scalar_product ns [] = 0
 2. \<And>a is ns. \<lbrakk>\<And>ns. \<forall>c\<in>set ns. c = 0 \<Longrightarrow> scalar_product ns is = 0; \<forall>c\<in>set ns. c = 0\<rbrakk> \<Longrightarrow> scalar_product ns (a # is) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>c\<in>set ?ns. c = 0 \<Longrightarrow> scalar_product ?ns is_ = 0
\<forall>c\<in>set ns. c = 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>c\<in>set ?ns. c = 0 \<Longrightarrow> scalar_product ?ns is_ = 0
\<forall>c\<in>set ns. c = 0

goal (1 subgoal):
 1. scalar_product ns (a_ # is_) = 0
[PROOF STEP]
by (cases ns) (auto simp: scalar_product_def cong del: if_weak_cong)
[PROOF STATE]
proof (state)
this:
scalar_product ns (a_ # is_) = 0

goal (1 subgoal):
 1. \<And>ns. \<forall>c\<in>set ns. c = 0 \<Longrightarrow> scalar_product ns [] = 0
[PROOF STEP]
qed (simp add: scalar_product_def)


[STATEMENT]
lemma nodes_ins_nodes[simp]: "nodes (ins_node v g) = insert v (nodes g)"
  and edges_ins_nodes[simp]: "edges (ins_node v g) = edges g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (ins_node v g) = insert v (nodes g) &&& edges (ins_node v g) = edges g
[PROOF STEP]
unfolding ins_node_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (graph (insert v (nodes g)) (edges g)) = insert v (nodes g) &&& edges (graph (insert v (nodes g)) (edges g)) = edges g
[PROOF STEP]
by (auto simp: graph_accs edges_sym')


[STATEMENT]
lemma dirichlet_prod_altdef1:
  "dirichlet_prod f g = (\<lambda>n. \<Sum>d | d dvd n. f (n div d) * g d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod f g = (\<lambda>n. \<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
show "dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
 2. n \<noteq> 0 \<Longrightarrow> dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
 2. n \<noteq> 0 \<Longrightarrow> dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
hence "dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div (n div d)) * g (n div d))"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div (n div d)) * g (n div d))
[PROOF STEP]
unfolding dirichlet_prod_def
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. f d * g (n div d)) = (\<Sum>d | d dvd n. f (n div (n div d)) * g (n div d))
[PROOF STEP]
by (intro sum.cong refl) (auto elim!: dvdE)
[PROOF STATE]
proof (state)
this:
dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div (n div d)) * g (n div d))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
 2. n \<noteq> 0 \<Longrightarrow> dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div (n div d)) * g (n div d))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
 2. n \<noteq> 0 \<Longrightarrow> dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
have "\<dots> = (\<Sum>d | d dvd n. f (n div d) * g d)"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. f (n div (n div d)) * g (n div d)) = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "(div) n" "(div) n"]) (auto elim!: dvdE)
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. f (n div (n div d)) * g (n div d)) = (\<Sum>d | d dvd n. f (n div d) * g d)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
 2. n \<noteq> 0 \<Longrightarrow> dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)

goal (1 subgoal):
 1. dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
dirichlet_prod f g n = (\<Sum>d | d dvd n. f (n div d) * g d)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sign_r_pos_minus:
  fixes p:: "real poly"
  assumes "p\<noteq>0"
  shows "sign_r_pos p x = (\<not> sign_r_pos (-p) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_r_pos p x = (\<not> sign_r_pos (- p) x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sign_r_pos p x = (\<not> sign_r_pos (- p) x)
[PROOF STEP]
have "sign_r_pos p x \<or> sign_r_pos (-p) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_r_pos p x \<or> sign_r_pos (- p) x
[PROOF STEP]
unfolding sign_r_pos_def eventually_at_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> 0 < poly p y) \<or> (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> 0 < poly (- p) y)
[PROOF STEP]
using next_non_root_interval[OF \<open>p\<noteq>0\<close>,unfolded not_eq_pos_or_neg_iff_1]
[PROOF STATE]
proof (prove)
using this:
(\<And>ub. \<lbrakk>?lb < ub; (\<forall>z. ?lb < z \<and> z \<le> ub \<longrightarrow> 0 < poly p z) \<or> (\<forall>z. ?lb < z \<and> z \<le> ub \<longrightarrow> poly p z < 0)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> 0 < poly p y) \<or> (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> 0 < poly (- p) y)
[PROOF STEP]
by (metis (erased, opaque_lifting) le_less minus_zero neg_less_iff_less poly_minus)
[PROOF STATE]
proof (state)
this:
sign_r_pos p x \<or> sign_r_pos (- p) x

goal (1 subgoal):
 1. sign_r_pos p x = (\<not> sign_r_pos (- p) x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sign_r_pos p x \<or> sign_r_pos (- p) x

goal (1 subgoal):
 1. sign_r_pos p x = (\<not> sign_r_pos (- p) x)
[PROOF STEP]
have "sign_r_pos p x \<Longrightarrow> \<not> sign_r_pos (-p) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_r_pos p x \<Longrightarrow> \<not> sign_r_pos (- p) x
[PROOF STEP]
unfolding sign_r_pos_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right x. 0 < poly p x \<Longrightarrow> \<not> (\<forall>\<^sub>F x in at_right x. 0 < poly (- p) x)
[PROOF STEP]
using eventually_neg[OF trivial_limit_at_right_real, of "\<lambda>x. poly p x > 0" x] poly_minus
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_right x. 0 < poly p x \<Longrightarrow> \<not> (\<forall>\<^sub>F x in at_right x. \<not> 0 < poly p x)
poly (- ?p) ?x = - poly ?p ?x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right x. 0 < poly p x \<Longrightarrow> \<not> (\<forall>\<^sub>F x in at_right x. 0 < poly (- p) x)
[PROOF STEP]
by (metis (lifting) eventually_mono less_asym neg_less_0_iff_less)
[PROOF STATE]
proof (state)
this:
sign_r_pos p x \<Longrightarrow> \<not> sign_r_pos (- p) x

goal (1 subgoal):
 1. sign_r_pos p x = (\<not> sign_r_pos (- p) x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sign_r_pos p x \<or> sign_r_pos (- p) x
sign_r_pos p x \<Longrightarrow> \<not> sign_r_pos (- p) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sign_r_pos p x \<or> sign_r_pos (- p) x
sign_r_pos p x \<Longrightarrow> \<not> sign_r_pos (- p) x

goal (1 subgoal):
 1. sign_r_pos p x = (\<not> sign_r_pos (- p) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sign_r_pos p x = (\<not> sign_r_pos (- p) x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma create_factor_tree: assumes "xs \<noteq> []"
  shows "factors_of_factor_tree (create_factor_tree xs) = mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. factors_of_factor_tree (create_factor_tree xs) = mset xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. factors_of_factor_tree (create_factor_tree xs) = mset xs
[PROOF STEP]
let ?xs = "rev (sort_key snd (map (\<lambda>f. (f, degree f)) xs))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. factors_of_factor_tree (create_factor_tree xs) = mset xs
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
xs \<noteq> []
[PROOF STEP]
have "set xs \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. set xs \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set xs \<noteq> {}

goal (1 subgoal):
 1. factors_of_factor_tree (create_factor_tree xs) = mset xs
[PROOF STEP]
hence "set ?xs \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
set xs \<noteq> {}

goal (1 subgoal):
 1. set (rev (sort_key snd (map (\<lambda>f. (f, degree f)) xs))) \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (rev (sort_key snd (map (\<lambda>f. (f, degree f)) xs))) \<noteq> {}

goal (1 subgoal):
 1. factors_of_factor_tree (create_factor_tree xs) = mset xs
[PROOF STEP]
hence xs: "?xs \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
set (rev (sort_key snd (map (\<lambda>f. (f, degree f)) xs))) \<noteq> {}

goal (1 subgoal):
 1. rev (sort_key snd (map (\<lambda>f. (f, degree f)) xs)) \<noteq> []
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rev (sort_key snd (map (\<lambda>f. (f, degree f)) xs)) \<noteq> []

goal (1 subgoal):
 1. factors_of_factor_tree (create_factor_tree xs) = mset xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. factors_of_factor_tree (create_factor_tree xs) = mset xs
[PROOF STEP]
unfolding create_factor_tree_def Let_def create_factor_tree_balanced[OF xs]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map fst (rev (sort_key snd (map (\<lambda>f. (f, degree f)) xs)))) = mset xs
[PROOF STEP]
by (auto, induct xs, auto)
[PROOF STATE]
proof (state)
this:
factors_of_factor_tree (create_factor_tree xs) = mset xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_to_sch_3: "c_fst n mod 7 = 3 \<Longrightarrow> nat_to_sch n = Base_snd"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_fst n mod 7 = 3 \<Longrightarrow> nat_to_sch n = Base_snd
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_fst n mod 7 = 3 \<Longrightarrow> nat_to_sch n = Base_snd
[PROOF STEP]
assume A1: "c_fst n mod 7 = 3"
[PROOF STATE]
proof (state)
this:
c_fst n mod 7 = 3

goal (1 subgoal):
 1. c_fst n mod 7 = 3 \<Longrightarrow> nat_to_sch n = Base_snd
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c_fst n mod 7 = 3
[PROOF STEP]
have "nat_to_sch n = (let u=(c_fst n) mod 7; v=c_snd n; v1=c_fst v; v2 = c_snd v; sch1=nat_to_sch v1; sch2=nat_to_sch v2 in loc_f u sch1 sch2)"
[PROOF STATE]
proof (prove)
using this:
c_fst n mod 7 = 3

goal (1 subgoal):
 1. nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))
[PROOF STEP]
by (simp add: loc_lm_2)
[PROOF STATE]
proof (state)
this:
nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))

goal (1 subgoal):
 1. c_fst n mod 7 = 3 \<Longrightarrow> nat_to_sch n = Base_snd
[PROOF STEP]
with A1
[PROOF STATE]
proof (chain)
picking this:
c_fst n mod 7 = 3
nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))
[PROOF STEP]
show "nat_to_sch n = Base_snd"
[PROOF STATE]
proof (prove)
using this:
c_fst n mod 7 = 3
nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))

goal (1 subgoal):
 1. nat_to_sch n = Base_snd
[PROOF STEP]
by (simp add: Let_def loc_f_def)
[PROOF STATE]
proof (state)
this:
nat_to_sch n = Base_snd

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma givenByD: "[| A \<in> givenBy v;  x \<in> A;  v x = v y |] ==> y \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> givenBy v; x \<in> A; v x = v y\<rbrakk> \<Longrightarrow> y \<in> A
[PROOF STEP]
by (unfold givenBy_def, auto)


[STATEMENT]
lemma list_all2_rel_prod_nth:
  assumes "list_all2 (rel_prod R1 R2) xs ys" and "n < length xs"
  shows "R1 (fst (xs ! n)) (fst (ys ! n)) \<and> R2 (snd (xs ! n)) (snd (ys ! n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R1 (fst (xs ! n)) (fst (ys ! n)) \<and> R2 (snd (xs ! n)) (snd (ys ! n))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
list_all2 (rel_prod R1 R2) xs ys
n < length xs

goal (1 subgoal):
 1. R1 (fst (xs ! n)) (fst (ys ! n)) \<and> R2 (snd (xs ! n)) (snd (ys ! n))
[PROOF STEP]
proof (induction n arbitrary: xs ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs ys. \<lbrakk>list_all2 (rel_prod R1 R2) xs ys; 0 < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! 0)) (fst (ys ! 0)) \<and> R2 (snd (xs ! 0)) (snd (ys ! 0))
 2. \<And>n xs ys. \<lbrakk>\<And>xs ys. \<lbrakk>list_all2 (rel_prod R1 R2) xs ys; n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! n)) (fst (ys ! n)) \<and> R2 (snd (xs ! n)) (snd (ys ! n)); list_all2 (rel_prod R1 R2) xs ys; Suc n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! Suc n)) (fst (ys ! Suc n)) \<and> R2 (snd (xs ! Suc n)) (snd (ys ! Suc n))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
list_all2 (rel_prod R1 R2) xs ys
0 < length xs

goal (2 subgoals):
 1. \<And>xs ys. \<lbrakk>list_all2 (rel_prod R1 R2) xs ys; 0 < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! 0)) (fst (ys ! 0)) \<and> R2 (snd (xs ! 0)) (snd (ys ! 0))
 2. \<And>n xs ys. \<lbrakk>\<And>xs ys. \<lbrakk>list_all2 (rel_prod R1 R2) xs ys; n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! n)) (fst (ys ! n)) \<and> R2 (snd (xs ! n)) (snd (ys ! n)); list_all2 (rel_prod R1 R2) xs ys; Suc n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! Suc n)) (fst (ys ! Suc n)) \<and> R2 (snd (xs ! Suc n)) (snd (ys ! Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all2 (rel_prod R1 R2) xs ys
0 < length xs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all2 (rel_prod R1 R2) xs ys
0 < length xs

goal (1 subgoal):
 1. R1 (fst (xs ! 0)) (fst (ys ! 0)) \<and> R2 (snd (xs ! 0)) (snd (ys ! 0))
[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
list_all2 (rel_prod R1 R2) xs ys
0 < length xs
list_all2 (rel_prod R1 R2) xs ys
n < length xs

goal (1 subgoal):
 1. R1 (fst (xs ! 0)) (fst (ys ! 0)) \<and> R2 (snd (xs ! 0)) (snd (ys ! 0))
[PROOF STEP]
by (auto elim: list.rel_cases)
[PROOF STATE]
proof (state)
this:
R1 (fst (xs ! 0)) (fst (ys ! 0)) \<and> R2 (snd (xs ! 0)) (snd (ys ! 0))

goal (1 subgoal):
 1. \<And>n xs ys. \<lbrakk>\<And>xs ys. \<lbrakk>list_all2 (rel_prod R1 R2) xs ys; n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! n)) (fst (ys ! n)) \<and> R2 (snd (xs ! n)) (snd (ys ! n)); list_all2 (rel_prod R1 R2) xs ys; Suc n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! Suc n)) (fst (ys ! Suc n)) \<and> R2 (snd (xs ! Suc n)) (snd (ys ! Suc n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n xs ys. \<lbrakk>\<And>xs ys. \<lbrakk>list_all2 (rel_prod R1 R2) xs ys; n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! n)) (fst (ys ! n)) \<and> R2 (snd (xs ! n)) (snd (ys ! n)); list_all2 (rel_prod R1 R2) xs ys; Suc n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! Suc n)) (fst (ys ! Suc n)) \<and> R2 (snd (xs ! Suc n)) (snd (ys ! Suc n))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>list_all2 (rel_prod R1 R2) ?xs ?ys; n < length ?xs\<rbrakk> \<Longrightarrow> R1 (fst (?xs ! n)) (fst (?ys ! n)) \<and> R2 (snd (?xs ! n)) (snd (?ys ! n))
list_all2 (rel_prod R1 R2) xs ys
Suc n < length xs

goal (1 subgoal):
 1. \<And>n xs ys. \<lbrakk>\<And>xs ys. \<lbrakk>list_all2 (rel_prod R1 R2) xs ys; n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! n)) (fst (ys ! n)) \<and> R2 (snd (xs ! n)) (snd (ys ! n)); list_all2 (rel_prod R1 R2) xs ys; Suc n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! Suc n)) (fst (ys ! Suc n)) \<and> R2 (snd (xs ! Suc n)) (snd (ys ! Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>list_all2 (rel_prod R1 R2) ?xs ?ys; n < length ?xs\<rbrakk> \<Longrightarrow> R1 (fst (?xs ! n)) (fst (?ys ! n)) \<and> R2 (snd (?xs ! n)) (snd (?ys ! n))
list_all2 (rel_prod R1 R2) xs ys
Suc n < length xs
[PROOF STEP]
obtain x xs' y ys' where xs_def[simp]: "xs = x # xs'" and ys_def[simp]: "ys = y # ys'"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>list_all2 (rel_prod R1 R2) ?xs ?ys; n < length ?xs\<rbrakk> \<Longrightarrow> R1 (fst (?xs ! n)) (fst (?ys ! n)) \<and> R2 (snd (?xs ! n)) (snd (?ys ! n))
list_all2 (rel_prod R1 R2) xs ys
Suc n < length xs

goal (1 subgoal):
 1. (\<And>x xs' y ys'. \<lbrakk>xs = x # xs'; ys = y # ys'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: list.rel_cases)
[PROOF STATE]
proof (state)
this:
xs = x # xs'
ys = y # ys'

goal (1 subgoal):
 1. \<And>n xs ys. \<lbrakk>\<And>xs ys. \<lbrakk>list_all2 (rel_prod R1 R2) xs ys; n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! n)) (fst (ys ! n)) \<and> R2 (snd (xs ! n)) (snd (ys ! n)); list_all2 (rel_prod R1 R2) xs ys; Suc n < length xs\<rbrakk> \<Longrightarrow> R1 (fst (xs ! Suc n)) (fst (ys ! Suc n)) \<and> R2 (snd (xs ! Suc n)) (snd (ys ! Suc n))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R1 (fst (xs ! Suc n)) (fst (ys ! Suc n)) \<and> R2 (snd (xs ! Suc n)) (snd (ys ! Suc n))
[PROOF STEP]
using Suc.prems Suc.IH[of xs' ys']
[PROOF STATE]
proof (prove)
using this:
list_all2 (rel_prod R1 R2) xs ys
Suc n < length xs
\<lbrakk>list_all2 (rel_prod R1 R2) xs' ys'; n < length xs'\<rbrakk> \<Longrightarrow> R1 (fst (xs' ! n)) (fst (ys' ! n)) \<and> R2 (snd (xs' ! n)) (snd (ys' ! n))

goal (1 subgoal):
 1. R1 (fst (xs ! Suc n)) (fst (ys ! Suc n)) \<and> R2 (snd (xs ! Suc n)) (snd (ys ! Suc n))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
R1 (fst (xs ! Suc n)) (fst (ys ! Suc n)) \<and> R2 (snd (xs ! Suc n)) (snd (ys ! Suc n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quasi_isometry_on_between:
  assumes "lambda C-quasi_isometry_on X f"
  shows "lambda C-quasi_isometry_between X (f`X) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda C -quasi_isometry_between X (f ` X) f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
lambda C -quasi_isometry_on X f

goal (1 subgoal):
 1. lambda C -quasi_isometry_between X (f ` X) f
[PROOF STEP]
unfolding quasi_isometry_between_def quasi_isometry_on_def
[PROOF STATE]
proof (prove)
using this:
1 \<le> lambda \<and> 0 \<le> C \<and> (\<forall>x\<in>X. \<forall>y\<in>X. dist (f x) (f y) \<le> lambda * dist x y + C \<and> 1 / lambda * dist x y - C \<le> dist (f x) (f y))

goal (1 subgoal):
 1. (1 \<le> lambda \<and> 0 \<le> C \<and> (\<forall>x\<in>X. \<forall>y\<in>X. dist (f x) (f y) \<le> lambda * dist x y + C \<and> 1 / lambda * dist x y - C \<le> dist (f x) (f y))) \<and> f ` X \<subseteq> f ` X \<and> (\<forall>y\<in>f ` X. \<exists>x\<in>X. dist (f x) y \<le> C)
[PROOF STEP]
by force


[STATEMENT]
lemma Nmul_eq0[simp]:
  assumes "SORT_CONSTRAINT('a::field_char_0)"
  assumes nx: "isnormNum x"
    and ny: "isnormNum y"
  shows "x*\<^sub>N y = 0\<^sub>N \<longleftrightarrow> x = 0\<^sub>N \<or> y = 0\<^sub>N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x *\<^sub>N y = 0\<^sub>N) = (x = 0\<^sub>N \<or> y = 0\<^sub>N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x *\<^sub>N y = 0\<^sub>N) = (x = 0\<^sub>N \<or> y = 0\<^sub>N)
[PROOF STEP]
obtain a b where x: "x = (a, b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. x = (a, b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases x)
[PROOF STATE]
proof (state)
this:
x = (a, b)

goal (1 subgoal):
 1. (x *\<^sub>N y = 0\<^sub>N) = (x = 0\<^sub>N \<or> y = 0\<^sub>N)
[PROOF STEP]
obtain a' b' where y: "y = (a', b')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a' b'. y = (a', b') \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases y)
[PROOF STATE]
proof (state)
this:
y = (a', b')

goal (1 subgoal):
 1. (x *\<^sub>N y = 0\<^sub>N) = (x = 0\<^sub>N \<or> y = 0\<^sub>N)
[PROOF STEP]
have n0: "isnormNum 0\<^sub>N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isnormNum 0\<^sub>N
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
isnormNum 0\<^sub>N

goal (1 subgoal):
 1. (x *\<^sub>N y = 0\<^sub>N) = (x = 0\<^sub>N \<or> y = 0\<^sub>N)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x *\<^sub>N y = 0\<^sub>N) = (x = 0\<^sub>N \<or> y = 0\<^sub>N)
[PROOF STEP]
using nx ny
[PROOF STATE]
proof (prove)
using this:
isnormNum x
isnormNum y

goal (1 subgoal):
 1. (x *\<^sub>N y = 0\<^sub>N) = (x = 0\<^sub>N \<or> y = 0\<^sub>N)
[PROOF STEP]
apply (simp only: isnormNum_unique[where ?'a = 'a, OF  Nmul_normN[OF nx ny] n0, symmetric]
      Nmul[where ?'a = 'a])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isnormNum x; isnormNum y\<rbrakk> \<Longrightarrow> (INum x * INum y = INum 0\<^sub>N) = (x = 0\<^sub>N \<or> y = 0\<^sub>N)
[PROOF STEP]
apply (simp add: x y INum_def split_def isnormNum_def split: if_split_asm)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(x *\<^sub>N y = 0\<^sub>N) = (x = 0\<^sub>N \<or> y = 0\<^sub>N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fold_pls'_eq: "Finite_Set.fold (pls' \<circ> g) z A = Finite_Set.fold (pls \<circ> g) z A"
  if "g ` A \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Set.fold (pls' \<circ> g) z A = Finite_Set.fold (pls \<circ> g) z A
[PROOF STEP]
using add_assoc add_commute add_mem zero_mem that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> S; ?b \<in> S; ?c \<in> S\<rbrakk> \<Longrightarrow> pls (pls ?a ?b) ?c = pls ?a (pls ?b ?c)
\<lbrakk>?a \<in> S; ?b \<in> S\<rbrakk> \<Longrightarrow> pls ?a ?b = pls ?b ?a
\<lbrakk>?a \<in> S; ?b \<in> S\<rbrakk> \<Longrightarrow> pls ?a ?b \<in> S
z \<in> S
g ` A \<subseteq> S

goal (1 subgoal):
 1. Finite_Set.fold (pls' \<circ> g) z A = Finite_Set.fold (pls \<circ> g) z A
[PROOF STEP]
by (intro fold_closed_eq[where B=S]) auto


[STATEMENT]
lemma allocationDisjointAuxiliary:
  assumes "a \<in> allocationsUniverse" and "n1 \<in> Domain a" and "n2 \<in> Domain a" and "n1 \<noteq> n2"
  shows "a,,n1 \<inter> a,,n2 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ,, n1 \<inter> a ,, n2 = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a ,, n1 \<inter> a ,, n2 = {}
[PROOF STEP]
have "Range a \<in> partitionsUniverse"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Range a \<in> partitionsUniverse
[PROOF STEP]
using assms nonOverlapping
[PROOF STATE]
proof (prove)
using this:
a \<in> allocationsUniverse
n1 \<in> Domain a
n2 \<in> Domain a
n1 \<noteq> n2
?R \<in> partitionValuedUniverse \<Longrightarrow> is_non_overlapping (Range ?R)

goal (1 subgoal):
 1. Range a \<in> partitionsUniverse
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Range a \<in> partitionsUniverse

goal (1 subgoal):
 1. a ,, n1 \<inter> a ,, n2 = {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Range a \<in> partitionsUniverse

goal (1 subgoal):
 1. a ,, n1 \<inter> a ,, n2 = {}
[PROOF STEP]
have "a \<in> injectionsUniverse & a \<in> partitionValuedUniverse"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> allocationsUniverse
n1 \<in> Domain a
n2 \<in> Domain a
n1 \<noteq> n2

goal (1 subgoal):
 1. a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
[PROOF STEP]
by (metis (lifting, no_types) IntD1 IntD2)
[PROOF STATE]
proof (state)
this:
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse

goal (1 subgoal):
 1. a ,, n1 \<inter> a ,, n2 = {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Range a \<in> partitionsUniverse
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
[PROOF STEP]
moreover
[PROOF STATE]
proof (chain)
picking this:
Range a \<in> partitionsUniverse
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
[PROOF STEP]
have "a,,n1 \<in> Range a"
[PROOF STATE]
proof (prove)
using this:
Range a \<in> partitionsUniverse
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse

goal (1 subgoal):
 1. a ,, n1 \<in> Range a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Range a \<in> partitionsUniverse
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
a \<in> allocationsUniverse
n1 \<in> Domain a
n2 \<in> Domain a
n1 \<noteq> n2

goal (1 subgoal):
 1. a ,, n1 \<in> Range a
[PROOF STEP]
by (metis (mono_tags) eval_runiq_in_Range mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
a ,, n1 \<in> Range a

goal (1 subgoal):
 1. a ,, n1 \<inter> a ,, n2 = {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Range a \<in> partitionsUniverse
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
a ,, n1 \<in> Range a
[PROOF STEP]
moreover
[PROOF STATE]
proof (chain)
picking this:
Range a \<in> partitionsUniverse
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
a ,, n1 \<in> Range a
[PROOF STEP]
have "a,,n1 \<noteq> a,,n2"
[PROOF STATE]
proof (prove)
using this:
Range a \<in> partitionsUniverse
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
a ,, n1 \<in> Range a

goal (1 subgoal):
 1. a ,, n1 \<noteq> a ,, n2
[PROOF STEP]
using assms converse.intros eval_runiq_rel mem_Collect_eq runiq_basic
[PROOF STATE]
proof (prove)
using this:
Range a \<in> partitionsUniverse
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
a ,, n1 \<in> Range a
a \<in> allocationsUniverse
n1 \<in> Domain a
n2 \<in> Domain a
n1 \<noteq> n2
(?a, ?b) \<in> ?r \<Longrightarrow> (?b, ?a) \<in> ?r\<inverse>
\<lbrakk>?x \<in> Domain ?R; runiq ?R\<rbrakk> \<Longrightarrow> (?x, ?R ,, ?x) \<in> ?R
(?a \<in> Collect ?P) = ?P ?a
runiq ?R = (\<forall>x y y'. (x, y) \<in> ?R \<and> (x, y') \<in> ?R \<longrightarrow> y = y')

goal (1 subgoal):
 1. a ,, n1 \<noteq> a ,, n2
[PROOF STEP]
by (metis (lifting, no_types))
[PROOF STATE]
proof (state)
this:
a ,, n1 \<noteq> a ,, n2

goal (1 subgoal):
 1. a ,, n1 \<inter> a ,, n2 = {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Range a \<in> partitionsUniverse
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
a ,, n1 \<in> Range a
a ,, n1 \<noteq> a ,, n2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Range a \<in> partitionsUniverse
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
a ,, n1 \<in> Range a
a ,, n1 \<noteq> a ,, n2

goal (1 subgoal):
 1. a ,, n1 \<inter> a ,, n2 = {}
[PROOF STEP]
using is_non_overlapping_def
[PROOF STATE]
proof (prove)
using this:
Range a \<in> partitionsUniverse
a \<in> injectionsUniverse \<and> a \<in> partitionValuedUniverse
a ,, n1 \<in> Range a
a ,, n1 \<noteq> a ,, n2
is_non_overlapping ?P = (\<forall>X\<in>?P. \<forall>Y\<in>?P. (X \<inter> Y \<noteq> {}) = (X = Y))

goal (1 subgoal):
 1. a ,, n1 \<inter> a ,, n2 = {}
[PROOF STEP]
by (metis (lifting, no_types) assms(3) eval_runiq_in_Range mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
a ,, n1 \<inter> a ,, n2 = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma null_sets_UN':
  assumes "countable I"
  assumes "\<And>i. i \<in> I \<Longrightarrow> N i \<in> null_sets M"
  shows "(\<Union>i\<in>I. N i) \<in> null_sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (N ` I) \<in> null_sets M
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<Union> (N ` I) \<in> null_sets M
 2. \<not> ?P \<Longrightarrow> \<Union> (N ` I) \<in> null_sets M
[PROOF STEP]
assume "I = {}"
[PROOF STATE]
proof (state)
this:
I = {}

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<Union> (N ` I) \<in> null_sets M
 2. \<not> ?P \<Longrightarrow> \<Union> (N ` I) \<in> null_sets M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
I = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
I = {}

goal (1 subgoal):
 1. \<Union> (N ` I) \<in> null_sets M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> (N ` I) \<in> null_sets M

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> \<Union> (N ` I) \<in> null_sets M
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> \<Union> (N ` I) \<in> null_sets M
[PROOF STEP]
assume "I \<noteq> {}"
[PROOF STATE]
proof (state)
this:
I \<noteq> {}

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> \<Union> (N ` I) \<in> null_sets M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (N ` I) \<in> null_sets M
[PROOF STEP]
proof (intro conjI CollectI null_setsI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. emeasure M (\<Union> (N ` I)) = 0
 2. \<Union> (N ` I) \<in> sets M
[PROOF STEP]
show "(\<Union>i\<in>I. N i) \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (N ` I) \<in> sets M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
countable I
?i \<in> I \<Longrightarrow> N ?i \<in> null_sets M

goal (1 subgoal):
 1. \<Union> (N ` I) \<in> sets M
[PROOF STEP]
by (intro sets.countable_UN') auto
[PROOF STATE]
proof (state)
this:
\<Union> (N ` I) \<in> sets M

goal (1 subgoal):
 1. emeasure M (\<Union> (N ` I)) = 0
[PROOF STEP]
have "emeasure M (\<Union>i\<in>I. N i) \<le> (\<Sum>n. emeasure M (N (from_nat_into I n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (\<Union> (N ` I)) \<le> (\<Sum>n. emeasure M (N (from_nat_into I n)))
[PROOF STEP]
unfolding UN_from_nat_into[OF \<open>countable I\<close> \<open>I \<noteq> {}\<close>]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (\<Union>i. N (from_nat_into I i)) \<le> (\<Sum>n. emeasure M (N (from_nat_into I n)))
[PROOF STEP]
using assms \<open>I \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
countable I
?i \<in> I \<Longrightarrow> N ?i \<in> null_sets M
I \<noteq> {}

goal (1 subgoal):
 1. emeasure M (\<Union>i. N (from_nat_into I i)) \<le> (\<Sum>n. emeasure M (N (from_nat_into I n)))
[PROOF STEP]
by (intro emeasure_subadditive_countably) (auto intro: from_nat_into)
[PROOF STATE]
proof (state)
this:
emeasure M (\<Union> (N ` I)) \<le> (\<Sum>n. emeasure M (N (from_nat_into I n)))

goal (1 subgoal):
 1. emeasure M (\<Union> (N ` I)) = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M (\<Union> (N ` I)) \<le> (\<Sum>n. emeasure M (N (from_nat_into I n)))

goal (1 subgoal):
 1. emeasure M (\<Union> (N ` I)) = 0
[PROOF STEP]
have "(\<lambda>n. emeasure M (N (from_nat_into I n))) = (\<lambda>_. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. emeasure M (N (from_nat_into I n))) = (\<lambda>_. 0)
[PROOF STEP]
using assms \<open>I \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
countable I
?i \<in> I \<Longrightarrow> N ?i \<in> null_sets M
I \<noteq> {}

goal (1 subgoal):
 1. (\<lambda>n. emeasure M (N (from_nat_into I n))) = (\<lambda>_. 0)
[PROOF STEP]
by (auto intro: from_nat_into)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. emeasure M (N (from_nat_into I n))) = (\<lambda>_. 0)

goal (1 subgoal):
 1. emeasure M (\<Union> (N ` I)) = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure M (\<Union> (N ` I)) \<le> (\<Sum>n. 0)
[PROOF STEP]
show "emeasure M (\<Union>i\<in>I. N i) = 0"
[PROOF STATE]
proof (prove)
using this:
emeasure M (\<Union> (N ` I)) \<le> (\<Sum>n. 0)

goal (1 subgoal):
 1. emeasure M (\<Union> (N ` I)) = 0
[PROOF STEP]
by (intro antisym zero_le) simp
[PROOF STATE]
proof (state)
this:
emeasure M (\<Union> (N ` I)) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Union> (N ` I) \<in> null_sets M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_dvd_fact_iff_int:
  "p dvd fact n \<longleftrightarrow> p \<le> int n" if "prime p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p dvd fact n) = (p \<le> int n)
[PROOF STEP]
using that prime_dvd_fact_iff [of "nat \<bar>p\<bar>" n]
[PROOF STATE]
proof (prove)
using this:
prime p
prime (nat \<bar>p\<bar>) \<Longrightarrow> (nat \<bar>p\<bar> dvd fact n) = (nat \<bar>p\<bar> \<le> n)

goal (1 subgoal):
 1. (p dvd fact n) = (p \<le> int n)
[PROOF STEP]
by auto (simp add: prime_ge_0_int)


[STATEMENT]
lemma eval_list_conj : "eval (list_conj F) L = (\<forall>f\<in>set(F). eval f L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (list_conj F) L = (\<forall>f\<in>set F. eval f L)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval (list_conj F) L = (\<forall>f\<in>set F. eval f L)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval (list_conj F) L = (\<forall>f\<in>set F. eval f L)
[PROOF STEP]
fix f F
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval (list_conj F) L = (\<forall>f\<in>set F. eval f L)
[PROOF STEP]
have h : "eval (foldr and F f) L = (eval f L \<and> (\<forall>f \<in> set F. eval f L))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (foldr PolyAtoms.and F f) L = (eval f L \<and> (\<forall>f\<in>set F. eval f L))
[PROOF STEP]
apply(induct F)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. eval (foldr PolyAtoms.and [] f) L = (eval f L \<and> (\<forall>f\<in>set []. eval f L))
 2. \<And>a F. eval (foldr PolyAtoms.and F f) L = (eval f L \<and> (\<forall>f\<in>set F. eval f L)) \<Longrightarrow> eval (foldr PolyAtoms.and (a # F) f) L = (eval f L \<and> (\<forall>f\<in>set (a # F). eval f L))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a F. eval (foldr PolyAtoms.and F f) L = (eval f L \<and> (\<forall>f\<in>set F. eval f L)) \<Longrightarrow> eval (foldr PolyAtoms.and (a # F) f) L = (eval f L \<and> (\<forall>f\<in>set (a # F). eval f L))
[PROOF STEP]
using eval_and
[PROOF STATE]
proof (prove)
using this:
eval (PolyAtoms.and ?a ?b) ?L = (eval ?a ?L \<and> eval ?b ?L)

goal (1 subgoal):
 1. \<And>a F. eval (foldr PolyAtoms.and F f) L = (eval f L \<and> (\<forall>f\<in>set F. eval f L)) \<Longrightarrow> eval (foldr PolyAtoms.and (a # F) f) L = (eval f L \<and> (\<forall>f\<in>set (a # F). eval f L))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eval (foldr PolyAtoms.and F f) L = (eval f L \<and> (\<forall>f\<in>set F. eval f L))

goal (1 subgoal):
 1. eval (list_conj F) L = (\<forall>f\<in>set F. eval f L)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
eval (foldr PolyAtoms.and ?Fa2 ?f2) L = (eval ?f2 L \<and> (\<forall>f\<in>set ?Fa2. eval f L))

goal (1 subgoal):
 1. eval (list_conj F) L = (\<forall>f\<in>set F. eval f L)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eval (foldr PolyAtoms.and ?Fa2 ?f2) L = (eval ?f2 L \<and> (\<forall>f\<in>set ?Fa2. eval f L))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
eval (foldr PolyAtoms.and ?Fa2 ?f2) L = (eval ?f2 L \<and> (\<forall>f\<in>set ?Fa2. eval f L))

goal (1 subgoal):
 1. eval (list_conj F) L = (\<forall>f\<in>set F. eval f L)
[PROOF STEP]
by(simp add:list_conj_def)
[PROOF STATE]
proof (state)
this:
eval (list_conj F) L = (\<forall>f\<in>set F. eval f L)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma GS_rec_fun_code'': "GS_rec_fun v = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GS_rec_fun v = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set UNIV)
[PROOF STEP]
using GS_rec_fun_code'
[PROOF STATE]
proof (prove)
using this:
GS_rec_fun ?v ?s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) ?v (sorted_list_of_set UNIV) ?s

goal (1 subgoal):
 1. GS_rec_fun v = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set UNIV)
[PROOF STEP]
by auto


[STATEMENT]
lemma suminf_exist_split:
  fixes r :: real
  assumes "0 < r" and "summable f"
  shows "\<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r
[PROOF STEP]
from LIMSEQ_D[OF summable_LIMSEQ[OF \<open>summable f\<close>] \<open>0 < r\<close>]
[PROOF STATE]
proof (chain)
picking this:
\<exists>no. \<forall>n\<ge>no. norm (sum f {..<n} - suminf f) < r
[PROOF STEP]
obtain N :: nat where "\<forall> n \<ge> N. norm (sum f {..<n} - suminf f) < r"
[PROOF STATE]
proof (prove)
using this:
\<exists>no. \<forall>n\<ge>no. norm (sum f {..<n} - suminf f) < r

goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. norm (sum f {..<n} - suminf f) < r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>N. norm (sum f {..<n} - suminf f) < r

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n\<ge>N. norm (sum f {..<n} - suminf f) < r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>N. norm (sum f {..<n} - suminf f) < r

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r
[PROOF STEP]
by (auto simp: norm_minus_commute suminf_minus_initial_segment[OF \<open>summable f\<close>])
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r

goal:
No subgoals!
[PROOF STEP]
qed