[STATEMENT]
lemma (in \<Z>) vfst_arrow_is_cat_Rel_arr'[cat_Rel_par_set_cs_intros]:
  assumes "A \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>"
    and "B \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>"
    and "AB = A \<times>\<^sub>\<circ> B"
    and "A' = A"
    and "\<CC>' = cat_Rel \<alpha>"
  shows "vfst_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> A'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfst_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> A'
[PROOF STEP]
using assms(1-2)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vfst_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> A'
[PROOF STEP]
unfolding assms(3-5)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vfst_arrow A B : A \<times>\<^sub>\<circ> B \<mapsto>\<^bsub>cat_Rel \<alpha>\<^esub> A
[PROOF STEP]
by (rule vfst_arrow_is_cat_Rel_arr)


[STATEMENT]
lemma "~~((P-->Q)  =  (~Q --> ~P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (P \<longrightarrow> Q) \<noteq> (\<not> Q \<longrightarrow> \<not> P)
[PROOF STEP]
by iprover


[STATEMENT]
lemma cross_ratio_real:
  assumes "is_real z" and "is_real u" and "is_real v" and "is_real w"
  assumes "z \<noteq> u \<and> v \<noteq> w \<or> z \<noteq> w \<and> u \<noteq> v"
  shows "is_real (to_complex (cross_ratio (of_complex z) (of_complex u) (of_complex v) (of_complex w)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_real (to_complex (cross_ratio (of_complex z) (of_complex u) (of_complex v) (of_complex w)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_real z
is_real u
is_real v
is_real w
z \<noteq> u \<and> v \<noteq> w \<or> z \<noteq> w \<and> u \<noteq> v

goal (1 subgoal):
 1. is_real (to_complex (cross_ratio (of_complex z) (of_complex u) (of_complex v) (of_complex w)))
[PROOF STEP]
by (transfer, transfer, auto)


[STATEMENT]
lemma root_char_poly_smult: fixes A :: "complex mat"
  assumes A: "A \<in> carrier_mat n n"
  and k: "k \<noteq> 0"
shows "(poly (char_poly (k \<cdot>\<^sub>m A)) x = 0) = (poly (char_poly A) (x / k) = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (char_poly (k \<cdot>\<^sub>m A)) x = 0) = (poly (char_poly A) (x / k) = 0)
[PROOF STEP]
using order_char_poly_smult[OF A k, of x]
[PROOF STATE]
proof (prove)
using this:
Polynomial.order x (char_poly (k \<cdot>\<^sub>m A)) = Polynomial.order (x / k) (char_poly A)

goal (1 subgoal):
 1. (poly (char_poly (k \<cdot>\<^sub>m A)) x = 0) = (poly (char_poly A) (x / k) = 0)
[PROOF STEP]
by (metis A degree_0 degree_monic_char_poly monic_degree_0 order_root smult_carrier_mat)


[STATEMENT]
lemma homeomorphic_map_path_components_of:
  assumes "homeomorphic_map X Y f"
  shows "path_components_of Y = (image f) ` (path_components_of X)"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_components_of Y = (`) f ` path_components_of X
[PROOF STEP]
unfolding path_components_of_def homeomorphic_imp_surjective_map [OF assms, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_of_set Y ` f ` topspace X = (`) f ` path_component_of_set X ` topspace X
[PROOF STEP]
using assms homeomorphic_map_path_component_of
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map X Y f
\<lbrakk>homeomorphic_map ?X ?Y ?f; ?x \<in> topspace ?X\<rbrakk> \<Longrightarrow> path_component_of_set ?Y (?f ?x) = ?f ` path_component_of_set ?X ?x

goal (1 subgoal):
 1. path_component_of_set Y ` f ` topspace X = (`) f ` path_component_of_set X ` topspace X
[PROOF STEP]
by fastforce


[STATEMENT]
lemma subspace_inter: "subspace A \<Longrightarrow> subspace B \<Longrightarrow> subspace (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>subspace A; subspace B\<rbrakk> \<Longrightarrow> subspace (A \<inter> B)
[PROOF STEP]
by (simp add: subspace_def)


[STATEMENT]
lemma map_M_pure_I : "\<And>h. (\<And>x. x \<in> set xs \<Longrightarrow> pure (f x) h) \<Longrightarrow> pure (map_M f xs) h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. (\<And>x. x \<in> set xs \<Longrightarrow> pure (f x) h) \<Longrightarrow> pure (map_M f xs) h
[PROOF STEP]
apply(induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>h. (\<And>x. x \<in> set [] \<Longrightarrow> pure (f x) h) \<Longrightarrow> pure (map_M f []) h
 2. \<And>a xs h. \<lbrakk>\<And>h. (\<And>x. x \<in> set xs \<Longrightarrow> pure (f x) h) \<Longrightarrow> pure (map_M f xs) h; \<And>x. x \<in> set (a # xs) \<Longrightarrow> pure (f x) h\<rbrakk> \<Longrightarrow> pure (map_M f (a # xs)) h
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs h. \<lbrakk>\<And>h. (\<And>x. x \<in> set xs \<Longrightarrow> pure (f x) h) \<Longrightarrow> pure (map_M f xs) h; \<And>x. x \<in> set (a # xs) \<Longrightarrow> pure (f x) h\<rbrakk> \<Longrightarrow> pure (map_M f (a # xs)) h
[PROOF STEP]
by(auto intro!: bind_pure_I)


[STATEMENT]
lemma AE_iff_nn_integral:
  "{x\<in>space M. P x} \<in> sets M \<Longrightarrow> (AE x in M. P x) \<longleftrightarrow> integral\<^sup>N M (indicator {x. \<not> P x}) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space M. P x} \<in> sets M \<Longrightarrow> almost_everywhere M P = (integral\<^sup>N M (indicator {x. \<not> P x}) = 0)
[PROOF STEP]
by (subst nn_integral_0_iff_AE) (auto simp: indicator_def[abs_def])


[STATEMENT]
lemma preal_add_mult_distrib2: "(w * ((x::preal) + y)) = (w * x) + (w * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w * (x + y) = w * x + w * y
[PROOF STEP]
by (metis Rep_preal_inverse distrib_subset1 distrib_subset2 subset_antisym)


[STATEMENT]
lemma f_aggregate_commute: "
  \<lbrakk> \<And>xs. length xs mod a = 0 \<Longrightarrow> ag (f_aggregate xs a ag) = ag xs;
    \<And>xs. length xs mod b = 0 \<Longrightarrow> ag (f_aggregate xs b ag) = ag xs \<rbrakk> \<Longrightarrow>
  f_aggregate (f_aggregate xs a ag) b ag = f_aggregate (f_aggregate xs b ag) a ag"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>xs. length xs mod a = 0 \<Longrightarrow> ag (f_aggregate xs a ag) = ag xs; \<And>xs. length xs mod b = 0 \<Longrightarrow> ag (f_aggregate xs b ag) = ag xs\<rbrakk> \<Longrightarrow> f_aggregate (f_aggregate xs a ag) b ag = f_aggregate (f_aggregate xs b ag) a ag
[PROOF STEP]
by (simp add: f_aggregate_assoc mult.commute[of _ b])


[STATEMENT]
lemma flatten_append: "flatten (xs@ys) = ((flatten xs) @ (flatten ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flatten (xs @ ys) = flatten xs @ flatten ys
[PROOF STEP]
apply(induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. flatten ([] @ ys) = flatten [] @ flatten ys
 2. \<And>a xs. flatten (xs @ ys) = flatten xs @ flatten ys \<Longrightarrow> flatten ((a # xs) @ ys) = flatten (a # xs) @ flatten ys
[PROOF STEP]
by auto


[STATEMENT]
lemma homeomorphic_map_involution:
   "\<lbrakk>continuous_map X X f; \<And>x. x \<in> topspace X \<Longrightarrow> f(f x) = x\<rbrakk> \<Longrightarrow> homeomorphic_map X X f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X X f; \<And>x. x \<in> topspace X \<Longrightarrow> f (f x) = x\<rbrakk> \<Longrightarrow> homeomorphic_map X X f
[PROOF STEP]
using homeomorphic_maps_involution homeomorphic_maps_map
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_map ?X ?X ?f; \<And>x. x \<in> topspace ?X \<Longrightarrow> ?f (?f x) = x\<rbrakk> \<Longrightarrow> homeomorphic_maps ?X ?X ?f ?f
homeomorphic_maps ?X ?Y ?f ?g = (homeomorphic_map ?X ?Y ?f \<and> homeomorphic_map ?Y ?X ?g \<and> (\<forall>x\<in>topspace ?X. ?g (?f x) = x) \<and> (\<forall>y\<in>topspace ?Y. ?f (?g y) = y))

goal (1 subgoal):
 1. \<lbrakk>continuous_map X X f; \<And>x. x \<in> topspace X \<Longrightarrow> f (f x) = x\<rbrakk> \<Longrightarrow> homeomorphic_map X X f
[PROOF STEP]
by blast


[STATEMENT]
lemma atom_step1: "r\<cdot>b \<le> b\<cdot>r \<Longrightarrow> (a + b + r)\<^sup>\<infinity> = b\<^sup>\<infinity>\<cdot>r\<^sup>\<infinity>\<cdot>(a\<cdot>b\<^sup>\<infinity>\<cdot>r\<^sup>\<infinity>)\<^sup>\<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<cdot> b \<le> b \<cdot> r \<Longrightarrow> (a + b + r)\<^sup>\<infinity> = b\<^sup>\<infinity> \<cdot> r\<^sup>\<infinity> \<cdot> (a \<cdot> b\<^sup>\<infinity> \<cdot> r\<^sup>\<infinity>)\<^sup>\<infinity>
[PROOF STEP]
apply (subgoal_tac "(a + b + r)\<^sup>\<infinity> = (b + r)\<^sup>\<infinity>\<cdot>(a\<cdot>(b + r)\<^sup>\<infinity>)\<^sup>\<infinity>")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>r \<cdot> b \<le> b \<cdot> r; (a + b + r)\<^sup>\<infinity> = (b + r)\<^sup>\<infinity> \<cdot> (a \<cdot> (b + r)\<^sup>\<infinity>)\<^sup>\<infinity>\<rbrakk> \<Longrightarrow> (a + b + r)\<^sup>\<infinity> = b\<^sup>\<infinity> \<cdot> r\<^sup>\<infinity> \<cdot> (a \<cdot> b\<^sup>\<infinity> \<cdot> r\<^sup>\<infinity>)\<^sup>\<infinity>
 2. r \<cdot> b \<le> b \<cdot> r \<Longrightarrow> (a + b + r)\<^sup>\<infinity> = (b + r)\<^sup>\<infinity> \<cdot> (a \<cdot> (b + r)\<^sup>\<infinity>)\<^sup>\<infinity>
[PROOF STEP]
apply (metis iteration_sep mult.assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<cdot> b \<le> b \<cdot> r \<Longrightarrow> (a + b + r)\<^sup>\<infinity> = (b + r)\<^sup>\<infinity> \<cdot> (a \<cdot> (b + r)\<^sup>\<infinity>)\<^sup>\<infinity>
[PROOF STEP]
by (metis add_assoc' add.commute iteration_denest)


[STATEMENT]
lemma len_verts_gt0: "length (g_V G) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < length (g_V G)
[PROOF STEP]
by (simp add:verts_not_empty)


[STATEMENT]
lemma subspace_orthogonal_complement: "subspace (orthogonal_complement W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.subspace (orthogonal_complement W)
[PROOF STEP]
unfolding subspace_def orthogonal_complement_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'b) \<in> {x. \<forall>y\<in>W. orthogonal y x} \<and> (\<forall>x\<in>{x. \<forall>y\<in>W. orthogonal y x}. \<forall>y\<in>{x. \<forall>y\<in>W. orthogonal y x}. x + y \<in> {x. \<forall>y\<in>W. orthogonal y x}) \<and> (\<forall>c. \<forall>x\<in>{x. \<forall>y\<in>W. orthogonal y x}. scale c x \<in> {x. \<forall>y\<in>W. orthogonal y x})
[PROOF STEP]
by (auto simp add: orthogonal_def local.inner_right_distrib)


[STATEMENT]
lemma rtrancl_Int:
 "\<lbrakk> (a,b) \<in> A; (a,b) \<in> B \<rbrakk> \<Longrightarrow> (a,b) \<in> (A \<inter>  B)^*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(a, b) \<in> A; (a, b) \<in> B\<rbrakk> \<Longrightarrow> (a, b) \<in> (A \<inter> B)\<^sup>*
[PROOF STEP]
by auto


[STATEMENT]
lemma fls_base_dvd1_subdegree_power:
  "f $$ fls_subdegree f dvd 1 \<Longrightarrow> fls_subdegree (f ^ n) = n * fls_subdegree f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f $$ fls_subdegree f dvd (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f
[PROOF STEP]
using fls_unit_base_subdegree_power
[PROOF STATE]
proof (prove)
using this:
?x * ?f $$ fls_subdegree ?f = (1::?'a) \<Longrightarrow> fls_subdegree (?f ^ ?n) = int ?n * fls_subdegree ?f
?f $$ fls_subdegree ?f * ?y = (1::?'a) \<Longrightarrow> fls_subdegree (?f ^ ?n) = int ?n * fls_subdegree ?f

goal (1 subgoal):
 1. f $$ fls_subdegree f dvd (1::'a) \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
?x * ?f $$ fls_subdegree ?f = (1::?'a) \<Longrightarrow> fls_subdegree (?f ^ ?n) = int ?n * fls_subdegree ?f
?f $$ fls_subdegree ?f * ?y = (1::?'a) \<Longrightarrow> fls_subdegree (?f ^ ?n) = int ?n * fls_subdegree ?f

goal (1 subgoal):
 1. \<exists>k. (1::'a) = f $$ fls_subdegree f * k \<Longrightarrow> fls_subdegree (f ^ n) = int n * fls_subdegree f
[PROOF STEP]
by auto


[STATEMENT]
theorem girth_chromatic:
  fixes l :: nat
  shows "\<exists>G. uwellformed G \<and> l < girth G \<and> l < chromatic_number G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
define k where "k = max 3 l"
[PROOF STATE]
proof (state)
this:
k = max 3 l

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
define \<epsilon> where "\<epsilon> = 1 / (2 * k)"
[PROOF STATE]
proof (state)
this:
\<epsilon> = 1 / real (2 * k)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
define p where "p n = real n powr (\<epsilon> - 1)" for n :: nat
[PROOF STATE]
proof (state)
this:
p ?n = real ?n powr (\<epsilon> - 1)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
let ?ug = edge_space.edge_ugraph
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
define short_count where "short_count g = card (short_cycles g k)" for g
    \<comment> \<open>This random variable differs from the one used in the proof of theorem 11.2.2,
          as we count the number of paths describing a circle, not the circles themselves\<close>
[PROOF STATE]
proof (state)
this:
short_count ?g = card (short_cycles ?g k)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
from k_def
[PROOF STATE]
proof (chain)
picking this:
k = max 3 l
[PROOF STEP]
have "3 \<le> k" "l \<le> k"
[PROOF STATE]
proof (prove)
using this:
k = max 3 l

goal (1 subgoal):
 1. 3 \<le> k &&& l \<le> k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 \<le> k
l \<le> k

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
from \<open>3 \<le> k\<close>
[PROOF STATE]
proof (chain)
picking this:
3 \<le> k
[PROOF STEP]
have \<epsilon>_props: "0 < \<epsilon>" "\<epsilon> < 1 / k" "\<epsilon> < 1"
[PROOF STATE]
proof (prove)
using this:
3 \<le> k

goal (1 subgoal):
 1. 0 < \<epsilon> &&& \<epsilon> < 1 / real k &&& \<epsilon> < 1
[PROOF STEP]
by (auto simp: \<epsilon>_def field_simps)
[PROOF STATE]
proof (state)
this:
0 < \<epsilon>
\<epsilon> < 1 / real k
\<epsilon> < 1

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have ev_p: "\<forall>\<^sup>\<infinity> n. 0 < p n \<and> p n < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1
[PROOF STEP]
proof (rule eventually_sequentiallyI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> 0 < p x \<and> p x < 1
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> 0 < p x \<and> p x < 1
[PROOF STEP]
assume "2 \<le> n"
[PROOF STATE]
proof (state)
this:
2 \<le> n

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> 0 < p x \<and> p x < 1
[PROOF STEP]
with \<open>\<epsilon> < 1\<close>
[PROOF STATE]
proof (chain)
picking this:
\<epsilon> < 1
2 \<le> n
[PROOF STEP]
have "n powr (\<epsilon> - 1) < 1"
[PROOF STATE]
proof (prove)
using this:
\<epsilon> < 1
2 \<le> n

goal (1 subgoal):
 1. real n powr (\<epsilon> - 1) < 1
[PROOF STEP]
by (auto intro!: powr_less_one)
[PROOF STATE]
proof (state)
this:
real n powr (\<epsilon> - 1) < 1

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> 0 < p x \<and> p x < 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real n powr (\<epsilon> - 1) < 1
[PROOF STEP]
show "0 < p n \<and> p n < 1"
[PROOF STATE]
proof (prove)
using this:
real n powr (\<epsilon> - 1) < 1

goal (1 subgoal):
 1. 0 < p n \<and> p n < 1
[PROOF STEP]
using \<open>2 \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
real n powr (\<epsilon> - 1) < 1
2 \<le> n

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1
[PROOF STEP]
have prob_short_count_le: "\<forall>\<^sup>\<infinity> n. probGn p n (\<lambda>es. (real n/2) \<le> short_count (?ug n es))
      \<le> 2 * (k - 2) * n powr (\<epsilon> * k - 1)"  (is "\<forall>\<^sup>\<infinity> n. ?P n")
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. probGn p n (\<lambda>es. real n / 2 \<le> real (short_count (edge_space.edge_ugraph n es))) \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)
[PROOF STEP]
proof (elim eventually_rev_mp, intro eventually_sequentiallyI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1; ?c3 \<le> x; 0 < p x \<and> p x < 1\<rbrakk> \<Longrightarrow> probGn p x (\<lambda>es. real x / 2 \<le> real (short_count (edge_space.edge_ugraph x es))) \<le> real (2 * (k - 2)) * real x powr (\<epsilon> * real k - 1)
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1; ?c3 \<le> x; 0 < p x \<and> p x < 1\<rbrakk> \<Longrightarrow> probGn p x (\<lambda>es. real x / 2 \<le> real (short_count (edge_space.edge_ugraph x es))) \<le> real (2 * (k - 2)) * real x powr (\<epsilon> * real k - 1)
[PROOF STEP]
assume A: "Suc k \<le> n" "0 < p n \<and> p n < 1"
[PROOF STATE]
proof (state)
this:
Suc k \<le> n
0 < p n \<and> p n < 1

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1; ?c3 \<le> x; 0 < p x \<and> p x < 1\<rbrakk> \<Longrightarrow> probGn p x (\<lambda>es. real x / 2 \<le> real (short_count (edge_space.edge_ugraph x es))) \<le> real (2 * (k - 2)) * real x powr (\<epsilon> * real k - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc k \<le> n
0 < p n \<and> p n < 1
[PROOF STEP]
interpret pG: edge_space n "p n"
[PROOF STATE]
proof (prove)
using this:
Suc k \<le> n
0 < p n \<and> p n < 1

goal (1 subgoal):
 1. edge_space (p n)
[PROOF STEP]
by unfold_locales auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1; ?c3 \<le> x; 0 < p x \<and> p x < 1\<rbrakk> \<Longrightarrow> probGn p x (\<lambda>es. real x / 2 \<le> real (short_count (edge_space.edge_ugraph x es))) \<le> real (2 * (k - 2)) * real x powr (\<epsilon> * real k - 1)
[PROOF STEP]
have "1 \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> n
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
Suc k \<le> n
0 < p n \<and> p n < 1

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

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1; ?c3 \<le> x; 0 < p x \<and> p x < 1\<rbrakk> \<Longrightarrow> probGn p x (\<lambda>es. real x / 2 \<le> real (short_count (edge_space.edge_ugraph x es))) \<le> real (2 * (k - 2)) * real x powr (\<epsilon> * real k - 1)
[PROOF STEP]
define mean_short_count where "mean_short_count = (\<integral>es. short_count (?ug n es) \<partial> pG.P)"
[PROOF STATE]
proof (state)
this:
mean_short_count = pG.expectation (\<lambda>x. real (short_count (pG.edge_ugraph x)))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1; ?c3 \<le> x; 0 < p x \<and> p x < 1\<rbrakk> \<Longrightarrow> probGn p x (\<lambda>es. real x / 2 \<le> real (short_count (edge_space.edge_ugraph x es))) \<le> real (2 * (k - 2)) * real x powr (\<epsilon> * real k - 1)
[PROOF STEP]
have mean_short_count_le: "mean_short_count \<le> (k - 2) * n powr (\<epsilon> * k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
have small_empty: "\<And>es k. k \<le> 2 \<Longrightarrow> short_cycles (edge_space.edge_ugraph n es) k = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>es k. k \<le> 2 \<Longrightarrow> short_cycles (pG.edge_ugraph es) k = {}
[PROOF STEP]
by (auto simp add: short_cycles_def ucycles_def)
[PROOF STATE]
proof (state)
this:
?k1 \<le> 2 \<Longrightarrow> short_cycles (pG.edge_ugraph ?es1) ?k1 = {}

goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
have short_count_conv: "\<And>es. short_count (?ug n es) = (\<Sum>i=3..k. real (card {c \<in> ucycles (?ug n es). uwalk_length c = i}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>es. real (short_count (pG.edge_ugraph es)) = (\<Sum>i = 3..k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
proof (unfold short_count_def, induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>es. real (card (short_cycles (pG.edge_ugraph es) 0)) = (\<Sum>i = 3..0. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
 2. \<And>k es. (\<And>es. real (card (short_cycles (pG.edge_ugraph es) k)) = (\<Sum>i = 3..k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))) \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>es. real (card (short_cycles (pG.edge_ugraph es) 0)) = (\<Sum>i = 3..0. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
 2. \<And>k es. (\<And>es. real (card (short_cycles (pG.edge_ugraph es) k)) = (\<Sum>i = 3..k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))) \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
with small_empty
[PROOF STATE]
proof (chain)
picking this:
?k1 \<le> 2 \<Longrightarrow> short_cycles (pG.edge_ugraph ?es1) ?k1 = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?k1 \<le> 2 \<Longrightarrow> short_cycles (pG.edge_ugraph ?es1) ?k1 = {}

goal (1 subgoal):
 1. real (card (short_cycles (pG.edge_ugraph es) 0)) = (\<Sum>i = 3..0. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (card (short_cycles (pG.edge_ugraph es) 0)) = (\<Sum>i = 3..0. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))

goal (1 subgoal):
 1. \<And>k es. (\<And>es. real (card (short_cycles (pG.edge_ugraph es) k)) = (\<Sum>i = 3..k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))) \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k es. (\<And>es. real (card (short_cycles (pG.edge_ugraph es) k)) = (\<Sum>i = 3..k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))) \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
real (card (short_cycles (pG.edge_ugraph ?es1) k)) = (\<Sum>i = 3..k. real (card {c \<in> ucycles (pG.edge_ugraph ?es1). uwalk_length c = i}))

goal (1 subgoal):
 1. \<And>k es. (\<And>es. real (card (short_cycles (pG.edge_ugraph es) k)) = (\<Sum>i = 3..k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))) \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
proof (cases "Suc k \<le> 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Suc k \<le> 2 \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
 2. \<not> Suc k \<le> 2 \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Suc k \<le> 2

goal (2 subgoals):
 1. Suc k \<le> 2 \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
 2. \<not> Suc k \<le> 2 \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
with small_empty
[PROOF STATE]
proof (chain)
picking this:
?k1 \<le> 2 \<Longrightarrow> short_cycles (pG.edge_ugraph ?es1) ?k1 = {}
Suc k \<le> 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?k1 \<le> 2 \<Longrightarrow> short_cycles (pG.edge_ugraph ?es1) ?k1 = {}
Suc k \<le> 2

goal (1 subgoal):
 1. real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))

goal (1 subgoal):
 1. \<not> Suc k \<le> 2 \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Suc k \<le> 2 \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> Suc k \<le> 2

goal (1 subgoal):
 1. \<not> Suc k \<le> 2 \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
have "{c \<in> ucycles (?ug n es). uwalk_length c \<le> Suc k}
              = {c \<in> ucycles (?ug n es). uwalk_length c \<le> k} \<union> {c \<in> ucycles (?ug n es). uwalk_length c = Suc k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} \<union> {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} \<union> {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}

goal (1 subgoal):
 1. \<not> Suc k \<le> 2 \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} \<union> {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}

goal (1 subgoal):
 1. \<not> Suc k \<le> 2 \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
have "finite (uverts (edge_space.edge_ugraph n es))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (uverts (pG.edge_ugraph es))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (uverts (pG.edge_ugraph es))

goal (1 subgoal):
 1. \<not> Suc k \<le> 2 \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} \<union> {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}
finite (uverts (pG.edge_ugraph es))
[PROOF STEP]
have "card {c \<in> ucycles (?ug n es). uwalk_length c \<le> Suc k}
            = card {c \<in> ucycles (?ug n es). uwalk_length c \<le> k} + card {c \<in> ucycles (?ug n es). uwalk_length c = Suc k}"
[PROOF STATE]
proof (prove)
using this:
{c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} \<union> {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}
finite (uverts (pG.edge_ugraph es))

goal (1 subgoal):
 1. card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} + card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}
[PROOF STEP]
using finite_ucycles
[PROOF STATE]
proof (prove)
using this:
{c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} \<union> {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}
finite (uverts (pG.edge_ugraph es))
finite (uverts ?G) \<Longrightarrow> finite (ucycles ?G)

goal (1 subgoal):
 1. card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} + card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}
[PROOF STEP]
by (subst card_Un_disjoint[symmetric]) auto
[PROOF STATE]
proof (state)
this:
card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} + card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}

goal (1 subgoal):
 1. \<not> Suc k \<le> 2 \<Longrightarrow> real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} + card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} + card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}

goal (1 subgoal):
 1. real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
using Suc False
[PROOF STATE]
proof (prove)
using this:
card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} + card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}
real (card (short_cycles (pG.edge_ugraph ?es1) k)) = (\<Sum>i = 3..k. real (card {c \<in> ucycles (pG.edge_ugraph ?es1). uwalk_length c = i}))
\<not> Suc k \<le> 2

goal (1 subgoal):
 1. real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
unfolding short_cycles_def
[PROOF STATE]
proof (prove)
using this:
card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> Suc k} = card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c \<le> k} + card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = Suc k}
real (card {p \<in> ucycles (pG.edge_ugraph ?es1). uwalk_length p \<le> k}) = (\<Sum>i = 3..k. real (card {c \<in> ucycles (pG.edge_ugraph ?es1). uwalk_length c = i}))
\<not> Suc k \<le> 2

goal (1 subgoal):
 1. real (card {p \<in> ucycles (pG.edge_ugraph es). uwalk_length p \<le> Suc k}) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))
[PROOF STEP]
by (auto simp: not_le)
[PROOF STATE]
proof (state)
this:
real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real (card (short_cycles (pG.edge_ugraph es) (Suc k))) = (\<Sum>i = 3..Suc k. real (card {c \<in> ucycles (pG.edge_ugraph es). uwalk_length c = i}))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real (short_count (pG.edge_ugraph ?es1)) = (\<Sum>i = 3..k. real (card {c \<in> ucycles (pG.edge_ugraph ?es1). uwalk_length c = i}))

goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
have "mean_short_count = (\<Sum>i=3..k. \<integral>es. card {c \<in> ucycles (?ug n es). uwalk_length c = i} \<partial> pG.P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mean_short_count = (\<Sum>i = 3..k. pG.expectation (\<lambda>x. real (card {c \<in> ucycles (pG.edge_ugraph x). uwalk_length c = i})))
[PROOF STEP]
unfolding mean_short_count_def short_count_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pG.expectation (\<lambda>x. \<Sum>i = 3..k. real (card {c \<in> ucycles (pG.edge_ugraph x). uwalk_length c = i})) = (\<Sum>i = 3..k. pG.expectation (\<lambda>x. real (card {c \<in> ucycles (pG.edge_ugraph x). uwalk_length c = i})))
[PROOF STEP]
by (subst Bochner_Integration.integral_sum) (auto intro: pG.integral_finite_singleton)
[PROOF STATE]
proof (state)
this:
mean_short_count = (\<Sum>i = 3..k. pG.expectation (\<lambda>x. real (card {c \<in> ucycles (pG.edge_ugraph x). uwalk_length c = i})))

goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mean_short_count = (\<Sum>i = 3..k. pG.expectation (\<lambda>x. real (card {c \<in> ucycles (pG.edge_ugraph x). uwalk_length c = i})))

goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>{3..k}. of_nat (fact n div fact (n - i)) * p n ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 3..k. pG.expectation (\<lambda>x. real (card {c \<in> ucycles (pG.edge_ugraph x). uwalk_length c = i}))) = (\<Sum>i = 3..k. real (fact n div fact (n - i)) * p n ^ i)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
Suc k \<le> n
0 < p n \<and> p n < 1

goal (1 subgoal):
 1. (\<Sum>i = 3..k. pG.expectation (\<lambda>x. real (card {c \<in> ucycles (pG.edge_ugraph x). uwalk_length c = i}))) = (\<Sum>i = 3..k. real (fact n div fact (n - i)) * p n ^ i)
[PROOF STEP]
by (simp add: pG.mean_k_cycles)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 3..k. pG.expectation (\<lambda>x. real (card {c \<in> ucycles (pG.edge_ugraph x). uwalk_length c = i}))) = (\<Sum>i = 3..k. real (fact n div fact (n - i)) * p n ^ i)

goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 3..k. pG.expectation (\<lambda>x. real (card {c \<in> ucycles (pG.edge_ugraph x). uwalk_length c = i}))) = (\<Sum>i = 3..k. real (fact n div fact (n - i)) * p n ^ i)

goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
have "\<dots> \<le> (\<Sum> i\<in>{3..k}. n ^ i * p n ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 3..k. real (fact n div fact (n - i)) * p n ^ i) \<le> (\<Sum>i = 3..k. real (n ^ i) * p n ^ i)
[PROOF STEP]
apply (rule sum_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> {3..k} \<Longrightarrow> real (fact n div fact (n - i)) * p n ^ i \<le> real (n ^ i) * p n ^ i
[PROOF STEP]
by (meson A fact_div_fact_le_pow  Suc_leD atLeastAtMost_iff of_nat_le_iff order_trans mult_le_cancel_iff1 zero_less_power)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 3..k. real (fact n div fact (n - i)) * p n ^ i) \<le> (\<Sum>i = 3..k. real (n ^ i) * p n ^ i)

goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 3..k. real (fact n div fact (n - i)) * p n ^ i) \<le> (\<Sum>i = 3..k. real (n ^ i) * p n ^ i)

goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
have "... \<le> (\<Sum> i\<in>{3..k}. n powr (\<epsilon> * k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 3..k. real (n ^ i) * p n ^ i) \<le> (\<Sum>i = 3..k. real n powr (\<epsilon> * real k))
[PROOF STEP]
using \<open>1 \<le> n\<close> \<open>0 < \<epsilon>\<close> A
[PROOF STATE]
proof (prove)
using this:
1 \<le> n
0 < \<epsilon>
Suc k \<le> n
0 < p n \<and> p n < 1

goal (1 subgoal):
 1. (\<Sum>i = 3..k. real (n ^ i) * p n ^ i) \<le> (\<Sum>i = 3..k. real n powr (\<epsilon> * real k))
[PROOF STEP]
by (intro sum_mono) (auto simp: p_def field_simps powr_mult_base powr_powr
          powr_realpow[symmetric] powr_mult[symmetric] powr_add[symmetric])
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 3..k. real (n ^ i) * p n ^ i) \<le> (\<Sum>i = 3..k. real n powr (\<epsilon> * real k))

goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mean_short_count \<le> (\<Sum>i = 3..k. real n powr (\<epsilon> * real k))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mean_short_count \<le> (\<Sum>i = 3..k. real n powr (\<epsilon> * real k))

goal (1 subgoal):
 1. mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1; ?c3 \<le> x; 0 < p x \<and> p x < 1\<rbrakk> \<Longrightarrow> probGn p x (\<lambda>es. real x / 2 \<le> real (short_count (edge_space.edge_ugraph x es))) \<le> real (2 * (k - 2)) * real x powr (\<epsilon> * real k - 1)
[PROOF STEP]
have "pG.prob {es \<in> space pG.P. n/2 \<le> short_count (?ug n es)} \<le> mean_short_count / (n/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pG.prob {es \<in> space pG.P. real n / 2 \<le> real (short_count (pG.edge_ugraph es))} \<le> mean_short_count / (real n / 2)
[PROOF STEP]
unfolding mean_short_count_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pG.prob {es \<in> space pG.P. real n / 2 \<le> real (short_count (pG.edge_ugraph es))} \<le> pG.expectation (\<lambda>x. real (short_count (pG.edge_ugraph x))) / (real n / 2)
[PROOF STEP]
using \<open>1 \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. pG.prob {es \<in> space pG.P. real n / 2 \<le> real (short_count (pG.edge_ugraph es))} \<le> pG.expectation (\<lambda>x. real (short_count (pG.edge_ugraph x))) / (real n / 2)
[PROOF STEP]
by (intro pG.Markov_inequality) (auto simp: short_count_def)
[PROOF STATE]
proof (state)
this:
pG.prob {es \<in> space pG.P. real n / 2 \<le> real (short_count (pG.edge_ugraph es))} \<le> mean_short_count / (real n / 2)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1; ?c3 \<le> x; 0 < p x \<and> p x < 1\<rbrakk> \<Longrightarrow> probGn p x (\<lambda>es. real x / 2 \<le> real (short_count (edge_space.edge_ugraph x es))) \<le> real (2 * (k - 2)) * real x powr (\<epsilon> * real k - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pG.prob {es \<in> space pG.P. real n / 2 \<le> real (short_count (pG.edge_ugraph es))} \<le> mean_short_count / (real n / 2)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1; ?c3 \<le> x; 0 < p x \<and> p x < 1\<rbrakk> \<Longrightarrow> probGn p x (\<lambda>es. real x / 2 \<le> real (short_count (edge_space.edge_ugraph x es))) \<le> real (2 * (k - 2)) * real x powr (\<epsilon> * real k - 1)
[PROOF STEP]
have "\<dots> \<le> 2 * (k - 2) * n powr (\<epsilon> * k - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mean_short_count / (real n / 2) \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mean_short_count / (real n / 2) \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)
[PROOF STEP]
have "mean_short_count / (n / 2) \<le> 2 * (k - 2) * (1 / n powr 1) * n powr (\<epsilon> * k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mean_short_count / (real n / 2) \<le> real (2 * (k - 2)) * (1 / real n powr 1) * real n powr (\<epsilon> * real k)
[PROOF STEP]
using mean_short_count_le \<open>1 \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
mean_short_count \<le> real (k - 2) * real n powr (\<epsilon> * real k)
1 \<le> n

goal (1 subgoal):
 1. mean_short_count / (real n / 2) \<le> real (2 * (k - 2)) * (1 / real n powr 1) * real n powr (\<epsilon> * real k)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
mean_short_count / (real n / 2) \<le> real (2 * (k - 2)) * (1 / real n powr 1) * real n powr (\<epsilon> * real k)

goal (1 subgoal):
 1. mean_short_count / (real n / 2) \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mean_short_count / (real n / 2) \<le> real (2 * (k - 2)) * (1 / real n powr 1) * real n powr (\<epsilon> * real k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mean_short_count / (real n / 2) \<le> real (2 * (k - 2)) * (1 / real n powr 1) * real n powr (\<epsilon> * real k)

goal (1 subgoal):
 1. mean_short_count / (real n / 2) \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)
[PROOF STEP]
by (simp add: powr_diff algebra_simps)
[PROOF STATE]
proof (state)
this:
mean_short_count / (real n / 2) \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mean_short_count / (real n / 2) \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1; ?c3 \<le> x; 0 < p x \<and> p x < 1\<rbrakk> \<Longrightarrow> probGn p x (\<lambda>es. real x / 2 \<le> real (short_count (edge_space.edge_ugraph x es))) \<le> real (2 * (k - 2)) * real x powr (\<epsilon> * real k - 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pG.prob {es \<in> space pG.P. real n / 2 \<le> real (short_count (pG.edge_ugraph es))} \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)
[PROOF STEP]
show "?P n"
[PROOF STATE]
proof (prove)
using this:
pG.prob {es \<in> space pG.P. real n / 2 \<le> real (short_count (pG.edge_ugraph es))} \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)

goal (1 subgoal):
 1. pG.prob {es \<in> space pG.P. real n / 2 \<le> real (short_count (pG.edge_ugraph es))} \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
pG.prob {es \<in> space pG.P. real n / 2 \<le> real (short_count (pG.edge_ugraph es))} \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. probGn p n (\<lambda>es. real n / 2 \<le> real (short_count (edge_space.edge_ugraph n es))) \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
define pf_short_count pf_\<alpha>
    where "pf_short_count n = probGn p n (\<lambda>es. n/2 \<le> short_count (?ug n es))"
      and "pf_\<alpha> n = probGn p n (\<lambda>es. 1/2 * n/k \<le> \<alpha> (edge_space.edge_ugraph n es))"
    for n
[PROOF STATE]
proof (state)
this:
pf_short_count ?n = probGn p ?n (\<lambda>es. real ?n / 2 \<le> real (short_count (edge_space.edge_ugraph ?n es)))
pf_\<alpha> ?n = probGn p ?n (\<lambda>es. ereal (1 / 2 * real ?n / real k) \<le> ereal_of_enat (\<alpha> (edge_space.edge_ugraph ?n es)))

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have ev_short_count_le: "\<forall>\<^sup>\<infinity> n. pf_short_count n < 1 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. pf_short_count n < 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. pf_short_count n < 1 / 2
[PROOF STEP]
have "\<epsilon> * k - 1 < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<epsilon> * real k - 1 < 0
[PROOF STEP]
using \<epsilon>_props \<open>3 \<le> k\<close>
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon>
\<epsilon> < 1 / real k
\<epsilon> < 1
3 \<le> k

goal (1 subgoal):
 1. \<epsilon> * real k - 1 < 0
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
\<epsilon> * real k - 1 < 0

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. pf_short_count n < 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<epsilon> * real k - 1 < 0
[PROOF STEP]
have "(\<lambda>n. 2 * (k - 2) * n powr (\<epsilon> * k - 1)) \<longlonglongrightarrow> 0" (is "?bound \<longlonglongrightarrow> 0")
[PROOF STATE]
proof (prove)
using this:
\<epsilon> * real k - 1 < 0

goal (1 subgoal):
 1. (\<lambda>n. real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)) \<longlonglongrightarrow> 0
[PROOF STEP]
by (intro tendsto_mult_right_zero LIMSEQ_neg_powr)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. pf_short_count n < 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "\<forall>\<^sup>\<infinity> n. dist (?bound n) 0  < 1 / 2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. dist (real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)) 0 < 1 / 2
[PROOF STEP]
by (rule tendstoD) simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. dist (real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)) 0 < 1 / 2

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. pf_short_count n < 1 / 2
[PROOF STEP]
with prob_short_count_le
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sup>\<infinity>n. probGn p n (\<lambda>es. real n / 2 \<le> real (short_count (edge_space.edge_ugraph n es))) \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)
\<forall>\<^sup>\<infinity>n. dist (real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)) 0 < 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sup>\<infinity>n. probGn p n (\<lambda>es. real n / 2 \<le> real (short_count (edge_space.edge_ugraph n es))) \<le> real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)
\<forall>\<^sup>\<infinity>n. dist (real (2 * (k - 2)) * real n powr (\<epsilon> * real k - 1)) 0 < 1 / 2

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. pf_short_count n < 1 / 2
[PROOF STEP]
by (rule eventually_elim2) (auto simp: dist_real_def pf_short_count_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. pf_short_count n < 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. pf_short_count n < 1 / 2

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have lim_\<alpha>: "pf_\<alpha> \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pf_\<alpha> \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pf_\<alpha> \<longlonglongrightarrow> 0
[PROOF STEP]
have "0 < k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k
[PROOF STEP]
using \<open>3 \<le> k\<close>
[PROOF STATE]
proof (prove)
using this:
3 \<le> k

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

goal (1 subgoal):
 1. pf_\<alpha> \<longlonglongrightarrow> 0
[PROOF STEP]
have "\<forall>\<^sup>\<infinity> n. (6*k) * ln n / n \<le> p n \<longleftrightarrow> (6*k) * ln n * n powr - \<epsilon> \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. (real (6 * k) * ln (real n) / real n \<le> p n) = (real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)
[PROOF STEP]
proof (rule eventually_sequentiallyI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> (real (6 * k) * ln (real x) / real x \<le> p x) = (real (6 * k) * ln (real x) * real x powr - \<epsilon> \<le> 1)
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> (real (6 * k) * ln (real x) / real x \<le> p x) = (real (6 * k) * ln (real x) * real x powr - \<epsilon> \<le> 1)
[PROOF STEP]
assume "1 \<le> n"
[PROOF STATE]
proof (state)
this:
1 \<le> n

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> (real (6 * k) * ln (real x) / real x \<le> p x) = (real (6 * k) * ln (real x) * real x powr - \<epsilon> \<le> 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> n
[PROOF STEP]
have "(6 * k) * ln n / n \<le> p n \<longleftrightarrow> (6*k) * ln n * (n powr - 1) \<le> n powr (\<epsilon> - 1)"
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. (real (6 * k) * ln (real n) / real n \<le> p n) = (real (6 * k) * ln (real n) * real n powr - 1 \<le> real n powr (\<epsilon> - 1))
[PROOF STEP]
by  (subst powr_minus) (simp add: divide_inverse p_def)
[PROOF STATE]
proof (state)
this:
(real (6 * k) * ln (real n) / real n \<le> p n) = (real (6 * k) * ln (real n) * real n powr - 1 \<le> real n powr (\<epsilon> - 1))

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> (real (6 * k) * ln (real x) / real x \<le> p x) = (real (6 * k) * ln (real x) * real x powr - \<epsilon> \<le> 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(real (6 * k) * ln (real n) / real n \<le> p n) = (real (6 * k) * ln (real n) * real n powr - 1 \<le> real n powr (\<epsilon> - 1))

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> (real (6 * k) * ln (real x) / real x \<le> p x) = (real (6 * k) * ln (real x) * real x powr - \<epsilon> \<le> 1)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (6*k) * ln n * ((n powr - 1) / (n powr (\<epsilon> - 1))) \<le> n powr (\<epsilon> - 1) / (n powr (\<epsilon> - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real (6 * k) * ln (real n) * real n powr - 1 \<le> real n powr (\<epsilon> - 1)) = (real (6 * k) * ln (real n) * (real n powr - 1 / real n powr (\<epsilon> - 1)) \<le> real n powr (\<epsilon> - 1) / real n powr (\<epsilon> - 1))
[PROOF STEP]
using \<open>1 \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. (real (6 * k) * ln (real n) * real n powr - 1 \<le> real n powr (\<epsilon> - 1)) = (real (6 * k) * ln (real n) * (real n powr - 1 / real n powr (\<epsilon> - 1)) \<le> real n powr (\<epsilon> - 1) / real n powr (\<epsilon> - 1))
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
(real (6 * k) * ln (real n) * real n powr - 1 \<le> real n powr (\<epsilon> - 1)) = (real (6 * k) * ln (real n) * (real n powr - 1 / real n powr (\<epsilon> - 1)) \<le> real n powr (\<epsilon> - 1) / real n powr (\<epsilon> - 1))

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> (real (6 * k) * ln (real x) / real x \<le> p x) = (real (6 * k) * ln (real x) * real x powr - \<epsilon> \<le> 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(real (6 * k) * ln (real n) * real n powr - 1 \<le> real n powr (\<epsilon> - 1)) = (real (6 * k) * ln (real n) * (real n powr - 1 / real n powr (\<epsilon> - 1)) \<le> real n powr (\<epsilon> - 1) / real n powr (\<epsilon> - 1))

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> (real (6 * k) * ln (real x) / real x \<le> p x) = (real (6 * k) * ln (real x) * real x powr - \<epsilon> \<le> 1)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (6*k) * ln n * n powr - \<epsilon> \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real (6 * k) * ln (real n) * (real n powr - 1 / real n powr (\<epsilon> - 1)) \<le> real n powr (\<epsilon> - 1) / real n powr (\<epsilon> - 1)) = (real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)
[PROOF STEP]
by (simp add: powr_diff [symmetric] )
[PROOF STATE]
proof (state)
this:
(real (6 * k) * ln (real n) * (real n powr - 1 / real n powr (\<epsilon> - 1)) \<le> real n powr (\<epsilon> - 1) / real n powr (\<epsilon> - 1)) = (real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)

goal (1 subgoal):
 1. \<And>x. ?c \<le> x \<Longrightarrow> (real (6 * k) * ln (real x) / real x \<le> p x) = (real (6 * k) * ln (real x) * real x powr - \<epsilon> \<le> 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(real (6 * k) * ln (real n) / real n \<le> p n) = (real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)
[PROOF STEP]
show "(6*k) * ln n / n \<le> p n \<longleftrightarrow> (6*k) * ln n * n powr - \<epsilon> \<le> 1"
[PROOF STATE]
proof (prove)
using this:
(real (6 * k) * ln (real n) / real n \<le> p n) = (real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)

goal (1 subgoal):
 1. (real (6 * k) * ln (real n) / real n \<le> p n) = (real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(real (6 * k) * ln (real n) / real n \<le> p n) = (real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. (real (6 * k) * ln (real n) / real n \<le> p n) = (real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)

goal (1 subgoal):
 1. pf_\<alpha> \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sup>\<infinity>n. (real (6 * k) * ln (real n) / real n \<le> p n) = (real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)
[PROOF STEP]
have "(\<forall>\<^sup>\<infinity> n. (6 * k) * ln n / real n \<le> p n)
        \<longleftrightarrow> (\<forall>\<^sup>\<infinity> n. (6*k) * ln n * n powr - \<epsilon> \<le> 1)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sup>\<infinity>n. (real (6 * k) * ln (real n) / real n \<le> p n) = (real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)

goal (1 subgoal):
 1. (\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) / real n \<le> p n) = (\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)
[PROOF STEP]
by (rule eventually_subst)
[PROOF STATE]
proof (state)
this:
(\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) / real n \<le> p n) = (\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)

goal (1 subgoal):
 1. pf_\<alpha> \<longlonglongrightarrow> 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) / real n \<le> p n) = (\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1)

goal (1 subgoal):
 1. pf_\<alpha> \<longlonglongrightarrow> 0
[PROOF STEP]
have "\<forall>\<^sup>\<infinity> n. (6*k) * ln n * n powr - \<epsilon> \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
assume "0 < n"
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
have "ln (real n) \<le> n powr (\<epsilon>/2) / (\<epsilon>/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (real n) \<le> real n powr (\<epsilon> / 2) / (\<epsilon> / 2)
[PROOF STEP]
using \<open>0 < n\<close> \<open>0 < \<epsilon>\<close>
[PROOF STATE]
proof (prove)
using this:
0 < n
0 < \<epsilon>

goal (1 subgoal):
 1. ln (real n) \<le> real n powr (\<epsilon> / 2) / (\<epsilon> / 2)
[PROOF STEP]
by (intro ln_powr_bound) auto
[PROOF STATE]
proof (state)
this:
ln (real n) \<le> real n powr (\<epsilon> / 2) / (\<epsilon> / 2)

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (real n) \<le> real n powr (\<epsilon> / 2) / (\<epsilon> / 2)

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
have "\<dots> \<le> 2/\<epsilon> * n powr (\<epsilon>/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n powr (\<epsilon> / 2) / (\<epsilon> / 2) \<le> 2 / \<epsilon> * real n powr (\<epsilon> / 2)
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
real n powr (\<epsilon> / 2) / (\<epsilon> / 2) \<le> 2 / \<epsilon> * real n powr (\<epsilon> / 2)

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (real n) \<le> 2 / \<epsilon> * real n powr (\<epsilon> / 2)
[PROOF STEP]
have "(6*k) * ln n * (n powr - \<epsilon>)  \<le> (6*k) * (2/\<epsilon> * n powr (\<epsilon>/2)) * (n powr - \<epsilon>)"
[PROOF STATE]
proof (prove)
using this:
ln (real n) \<le> 2 / \<epsilon> * real n powr (\<epsilon> / 2)

goal (1 subgoal):
 1. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> real (6 * k) * (2 / \<epsilon> * real n powr (\<epsilon> / 2)) * real n powr - \<epsilon>
[PROOF STEP]
using \<open>0 < n\<close> \<open>0 < k\<close>
[PROOF STATE]
proof (prove)
using this:
ln (real n) \<le> 2 / \<epsilon> * real n powr (\<epsilon> / 2)
0 < n
0 < k

goal (1 subgoal):
 1. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> real (6 * k) * (2 / \<epsilon> * real n powr (\<epsilon> / 2)) * real n powr - \<epsilon>
[PROOF STEP]
by (intro mult_right_mono mult_left_mono) auto
[PROOF STATE]
proof (state)
this:
real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> real (6 * k) * (2 / \<epsilon> * real n powr (\<epsilon> / 2)) * real n powr - \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> real (6 * k) * (2 / \<epsilon> * real n powr (\<epsilon> / 2)) * real n powr - \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
have "\<dots> = 12*k/\<epsilon> * n powr (-\<epsilon>/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (6 * k) * (2 / \<epsilon> * real n powr (\<epsilon> / 2)) * real n powr - \<epsilon> = real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)
[PROOF STEP]
unfolding divide_inverse
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (6 * k) * (2 * inverse \<epsilon> * real n powr (\<epsilon> * inverse 2)) * real n powr - \<epsilon> = real (12 * k) * inverse \<epsilon> * real n powr (- \<epsilon> * inverse 2)
[PROOF STEP]
by (auto simp: field_simps powr_minus[symmetric] powr_add[symmetric])
[PROOF STATE]
proof (state)
this:
real (6 * k) * (2 / \<epsilon> * real n powr (\<epsilon> / 2)) * real n powr - \<epsilon> = real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)
[PROOF STEP]
have "(6*k) * ln n * (n powr - \<epsilon>) \<le> 12*k/\<epsilon> * n powr (-\<epsilon>/2)"
[PROOF STATE]
proof (prove)
using this:
real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)

goal (1 subgoal):
 1. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 < ?n2 \<Longrightarrow> real (6 * k) * ln (real ?n2) * real ?n2 powr - \<epsilon> \<le> real (12 * k) / \<epsilon> * real ?n2 powr (- \<epsilon> / 2)

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?n2 \<Longrightarrow> real (6 * k) * ln (real ?n2) * real ?n2 powr - \<epsilon> \<le> real (12 * k) / \<epsilon> * real ?n2 powr (- \<epsilon> / 2)
[PROOF STEP]
have "\<forall>\<^sup>\<infinity> n. (6*k) * ln n * (n powr - \<epsilon>) \<le> 12*k/\<epsilon> * n powr (-\<epsilon>/2)"
[PROOF STATE]
proof (prove)
using this:
0 < ?n2 \<Longrightarrow> real (6 * k) * ln (real ?n2) * real ?n2 powr - \<epsilon> \<le> real (12 * k) / \<epsilon> * real ?n2 powr (- \<epsilon> / 2)

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)
[PROOF STEP]
by (intro eventually_sequentiallyI[of 1]) auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
have "\<forall>\<^sup>\<infinity> n. 12*k/\<epsilon> * n powr (-\<epsilon>/2) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2) \<le> 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2) \<le> 1
[PROOF STEP]
have "(\<lambda>n. 12*k/\<epsilon> * n powr (-\<epsilon>/2)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)) \<longlonglongrightarrow> 0
[PROOF STEP]
using \<open>0 < \<epsilon>\<close>
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon>

goal (1 subgoal):
 1. (\<lambda>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)) \<longlonglongrightarrow> 0
[PROOF STEP]
by (intro tendsto_mult_right_zero LIMSEQ_neg_powr) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2) \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)) \<longlonglongrightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2) \<le> 1
[PROOF STEP]
using \<open>0 < \<epsilon>\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2)) \<longlonglongrightarrow> 0
0 < \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2) \<le> 1
[PROOF STEP]
by - (drule tendstoD[where e=1], auto elim: eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2) \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. real (12 * k) / \<epsilon> * real n powr (- \<epsilon> / 2) \<le> 1

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
finally (eventually_le_le)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sup>\<infinity>x. real (6 * k) * ln (real x) * real x powr - \<epsilon> \<le> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sup>\<infinity>x. real (6 * k) * ln (real x) * real x powr - \<epsilon> \<le> 1

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) * real n powr - \<epsilon> \<le> 1

goal (1 subgoal):
 1. pf_\<alpha> \<longlonglongrightarrow> 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) / real n \<le> p n
[PROOF STEP]
have "\<forall>\<^sup>\<infinity> n. real (6 * k) * ln (real n) / real n \<le> p n"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) / real n \<le> p n

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) / real n \<le> p n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) / real n \<le> p n

goal (1 subgoal):
 1. pf_\<alpha> \<longlonglongrightarrow> 0
[PROOF STEP]
with ev_p \<open>0 < k\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1
0 < k
\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) / real n \<le> p n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1
0 < k
\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) / real n \<le> p n

goal (1 subgoal):
 1. pf_\<alpha> \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding pf_\<alpha>_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1
0 < k
\<forall>\<^sup>\<infinity>n. real (6 * k) * ln (real n) / real n \<le> p n

goal (1 subgoal):
 1. (\<lambda>n. probGn p n (\<lambda>es. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (edge_space.edge_ugraph n es)))) \<longlonglongrightarrow> 0
[PROOF STEP]
by (rule almost_never_le_\<alpha>)
[PROOF STATE]
proof (state)
this:
pf_\<alpha> \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pf_\<alpha> \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
from ev_short_count_le lim_\<alpha>[THEN tendstoD, of "1/2"] ev_p
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sup>\<infinity>n. pf_short_count n < 1 / 2
0 < 1 / 2 \<Longrightarrow> \<forall>\<^sup>\<infinity>x. dist (pf_\<alpha> x) 0 < 1 / 2
\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1
[PROOF STEP]
have "\<forall>\<^sup>\<infinity> n. 0 < p n \<and> p n < 1 \<and> pf_short_count n < 1/2 \<and> pf_\<alpha> n < 1/2"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sup>\<infinity>n. pf_short_count n < 1 / 2
0 < 1 / 2 \<Longrightarrow> \<forall>\<^sup>\<infinity>x. dist (pf_\<alpha> x) 0 < 1 / 2
\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1

goal (1 subgoal):
 1. \<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1 \<and> pf_short_count n < 1 / 2 \<and> pf_\<alpha> n < 1 / 2
[PROOF STEP]
by simp (elim eventually_rev_mp, auto simp: eventually_sequentially dist_real_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1 \<and> pf_short_count n < 1 / 2 \<and> pf_\<alpha> n < 1 / 2

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1 \<and> pf_short_count n < 1 / 2 \<and> pf_\<alpha> n < 1 / 2
[PROOF STEP]
obtain n where "0 < p n" "p n < 1" and [arith]: "0 < n"
      and probs: "pf_short_count n < 1/2" "pf_\<alpha> n < 1/2"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sup>\<infinity>n. 0 < p n \<and> p n < 1 \<and> pf_short_count n < 1 / 2 \<and> pf_\<alpha> n < 1 / 2

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>0 < p n; p n < 1; 0 < n; pf_short_count n < 1 / 2; pf_\<alpha> n < 1 / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_sequentially)
[PROOF STATE]
proof (state)
this:
0 < p n
p n < 1
0 < n
pf_short_count n < 1 / 2
pf_\<alpha> n < 1 / 2

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < p n
p n < 1
0 < n
pf_short_count n < 1 / 2
pf_\<alpha> n < 1 / 2
[PROOF STEP]
interpret ES: edge_space n "(p n)"
[PROOF STATE]
proof (prove)
using this:
0 < p n
p n < 1
0 < n
pf_short_count n < 1 / 2
pf_\<alpha> n < 1 / 2

goal (1 subgoal):
 1. edge_space (p n)
[PROOF STEP]
by unfold_locales auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have rest_compl: "\<And>A P. A - {x\<in>A. P x} = {x\<in>A. \<not>P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A P. A - {x \<in> A. P x} = {x \<in> A. \<not> P x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?A1 - {x \<in> ?A1. ?P1 x} = {x \<in> ?A1. \<not> ?P1 x}

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
from probs
[PROOF STATE]
proof (chain)
picking this:
pf_short_count n < 1 / 2
pf_\<alpha> n < 1 / 2
[PROOF STEP]
have "ES.prob ({es \<in> space ES.P. n/2 \<le> short_count (?ug n es)}
      \<union> {es \<in> space ES.P. 1/2 * n/k \<le> \<alpha> (?ug n es)}) \<le> pf_short_count n + pf_\<alpha> n"
[PROOF STATE]
proof (prove)
using this:
pf_short_count n < 1 / 2
pf_\<alpha> n < 1 / 2

goal (1 subgoal):
 1. ES.prob ({es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} \<union> {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}) \<le> pf_short_count n + pf_\<alpha> n
[PROOF STEP]
unfolding pf_short_count_def pf_\<alpha>_def
[PROOF STATE]
proof (prove)
using this:
ES.prob {es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} < 1 / 2
ES.prob {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))} < 1 / 2

goal (1 subgoal):
 1. ES.prob ({es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} \<union> {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}) \<le> ES.prob {es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} + ES.prob {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}
[PROOF STEP]
by (subst ES.finite_measure_subadditive) auto
[PROOF STATE]
proof (state)
this:
ES.prob ({es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} \<union> {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}) \<le> pf_short_count n + pf_\<alpha> n

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ES.prob ({es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} \<union> {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}) \<le> pf_short_count n + pf_\<alpha> n

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have "\<dots> < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pf_short_count n + pf_\<alpha> n < 1
[PROOF STEP]
using probs
[PROOF STATE]
proof (prove)
using this:
pf_short_count n < 1 / 2
pf_\<alpha> n < 1 / 2

goal (1 subgoal):
 1. pf_short_count n + pf_\<alpha> n < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pf_short_count n + pf_\<alpha> n < 1

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ES.prob ({es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} \<union> {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}) < 1
[PROOF STEP]
have "0 < ES.prob (space ES.P - ({es \<in> space ES.P. n/2 \<le> short_count (?ug n es)}
      \<union> {es \<in> space ES.P. 1/2 * n/k \<le> \<alpha> (?ug n es)}))" (is "0 < ES.prob ?S")
[PROOF STATE]
proof (prove)
using this:
ES.prob ({es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} \<union> {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}) < 1

goal (1 subgoal):
 1. 0 < ES.prob (space ES.P - ({es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} \<union> {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}))
[PROOF STEP]
by (subst ES.prob_compl) auto
[PROOF STATE]
proof (state)
this:
0 < ES.prob (space ES.P - ({es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} \<union> {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}))

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < ES.prob (space ES.P - ({es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} \<union> {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}))

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have "?S = {es \<in> space ES.P. short_count (?ug n es) < n/2 \<and> \<alpha> (?ug n es) < 1/2* n/k}" (is "\<dots> = ?C")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space ES.P - ({es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} \<union> {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}) = {es \<in> space ES.P. real (short_count (ES.edge_ugraph es)) < real n / 2 \<and> ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)}
[PROOF STEP]
by (auto simp: not_less rest_compl)
[PROOF STATE]
proof (state)
this:
space ES.P - ({es \<in> space ES.P. real n / 2 \<le> real (short_count (ES.edge_ugraph es))} \<union> {es \<in> space ES.P. ereal (1 / 2 * real n / real k) \<le> ereal_of_enat (\<alpha> (ES.edge_ugraph es))}) = {es \<in> space ES.P. real (short_count (ES.edge_ugraph es)) < real n / 2 \<and> ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)}

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < ES.prob {es \<in> space ES.P. real (short_count (ES.edge_ugraph es)) < real n / 2 \<and> ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)}
[PROOF STEP]
have "?C \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
0 < ES.prob {es \<in> space ES.P. real (short_count (ES.edge_ugraph es)) < real n / 2 \<and> ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)}

goal (1 subgoal):
 1. {es \<in> space ES.P. real (short_count (ES.edge_ugraph es)) < real n / 2 \<and> ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)} \<noteq> {}
[PROOF STEP]
by (intro notI) (simp only:, auto)
[PROOF STATE]
proof (state)
this:
{es \<in> space ES.P. real (short_count (ES.edge_ugraph es)) < real n / 2 \<and> ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)} \<noteq> {}

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{es \<in> space ES.P. real (short_count (ES.edge_ugraph es)) < real n / 2 \<and> ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)} \<noteq> {}
[PROOF STEP]
obtain es where es_props: "es \<in> space ES.P"
      "short_count (?ug n es) < n/2" "\<alpha> (?ug n es) < 1/2 * n/k"
[PROOF STATE]
proof (prove)
using this:
{es \<in> space ES.P. real (short_count (ES.edge_ugraph es)) < real n / 2 \<and> ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)} \<noteq> {}

goal (1 subgoal):
 1. (\<And>es. \<lbrakk>es \<in> space ES.P; real (short_count (ES.edge_ugraph es)) < real n / 2; ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
    \<comment> \<open>now we obtained a high colored graph (few independent nodes) with almost no short cycles\<close>
[PROOF STATE]
proof (state)
this:
es \<in> space ES.P
real (short_count (ES.edge_ugraph es)) < real n / 2
ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
define G where "G = ?ug n es"
[PROOF STATE]
proof (state)
this:
G = ES.edge_ugraph es

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
define H where "H = kill_short G k"
[PROOF STATE]
proof (state)
this:
H = kill_short G k

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have G_props: "uverts G = {1..n}" "finite (uverts G)" "short_count G < n/2" "\<alpha> G < 1/2 * n/k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (uverts G = {1..n} &&& finite (uverts G)) &&& real (short_count G) < real n / 2 &&& ereal_of_enat (\<alpha> G) < ereal (1 / 2 * real n / real k)
[PROOF STEP]
unfolding G_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (uverts (ES.edge_ugraph es) = {1..n} &&& finite (uverts (ES.edge_ugraph es))) &&& real (short_count (ES.edge_ugraph es)) < real n / 2 &&& ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)
[PROOF STEP]
using es_props
[PROOF STATE]
proof (prove)
using this:
es \<in> space ES.P
real (short_count (ES.edge_ugraph es)) < real n / 2
ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)

goal (1 subgoal):
 1. (uverts (ES.edge_ugraph es) = {1..n} &&& finite (uverts (ES.edge_ugraph es))) &&& real (short_count (ES.edge_ugraph es)) < real n / 2 &&& ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)
[PROOF STEP]
by (auto simp: ES.S_verts_def)
[PROOF STATE]
proof (state)
this:
uverts G = {1..n}
finite (uverts G)
real (short_count G) < real n / 2
ereal_of_enat (\<alpha> G) < ereal (1 / 2 * real n / real k)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have "uwellformed G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uwellformed G
[PROOF STEP]
by (auto simp: G_def uwellformed_def all_edges_def ES.S_edges_def)
[PROOF STATE]
proof (state)
this:
uwellformed G

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
with G_props
[PROOF STATE]
proof (chain)
picking this:
uverts G = {1..n}
finite (uverts G)
real (short_count G) < real n / 2
ereal_of_enat (\<alpha> G) < ereal (1 / 2 * real n / real k)
uwellformed G
[PROOF STEP]
have T1: "uwellformed H"
[PROOF STATE]
proof (prove)
using this:
uverts G = {1..n}
finite (uverts G)
real (short_count G) < real n / 2
ereal_of_enat (\<alpha> G) < ereal (1 / 2 * real n / real k)
uwellformed G

goal (1 subgoal):
 1. uwellformed H
[PROOF STEP]
unfolding H_def
[PROOF STATE]
proof (prove)
using this:
uverts G = {1..n}
finite (uverts G)
real (short_count G) < real n / 2
ereal_of_enat (\<alpha> G) < ereal (1 / 2 * real n / real k)
uwellformed G

goal (1 subgoal):
 1. uwellformed (kill_short G k)
[PROOF STEP]
by (intro kill_short_uwellformed)
[PROOF STATE]
proof (state)
this:
uwellformed H

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have "enat l \<le> enat k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat l \<le> enat k
[PROOF STEP]
using \<open>l \<le> k\<close>
[PROOF STATE]
proof (prove)
using this:
l \<le> k

goal (1 subgoal):
 1. enat l \<le> enat k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
enat l \<le> enat k

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
enat l \<le> enat k

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have "\<dots> < girth H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat k < girth H
[PROOF STEP]
using G_props
[PROOF STATE]
proof (prove)
using this:
uverts G = {1..n}
finite (uverts G)
real (short_count G) < real n / 2
ereal_of_enat (\<alpha> G) < ereal (1 / 2 * real n / real k)

goal (1 subgoal):
 1. enat k < girth H
[PROOF STEP]
by (auto simp: kill_short_large_girth H_def)
[PROOF STATE]
proof (state)
this:
enat k < girth H

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
enat l < girth H
[PROOF STEP]
have T2: "l < girth H"
[PROOF STATE]
proof (prove)
using this:
enat l < girth H

goal (1 subgoal):
 1. enat l < girth H
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
enat l < girth H

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have card_H: "n/2 \<le> card (uverts H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n / 2 \<le> real (card (uverts H))
[PROOF STEP]
using G_props es_props kill_short_order_of_graph[of G k]
[PROOF STATE]
proof (prove)
using this:
uverts G = {1..n}
finite (uverts G)
real (short_count G) < real n / 2
ereal_of_enat (\<alpha> G) < ereal (1 / 2 * real n / real k)
es \<in> space ES.P
real (short_count (ES.edge_ugraph es)) < real n / 2
ereal_of_enat (\<alpha> (ES.edge_ugraph es)) < ereal (1 / 2 * real n / real k)
finite (uverts G) \<Longrightarrow> card (uverts G) - card (short_cycles G k) \<le> card (uverts (kill_short G k))

goal (1 subgoal):
 1. real n / 2 \<le> real (card (uverts H))
[PROOF STEP]
by (simp add: short_count_def H_def)
[PROOF STATE]
proof (state)
this:
real n / 2 \<le> real (card (uverts H))

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real n / 2 \<le> real (card (uverts H))
[PROOF STEP]
have uverts_H: "uverts H \<noteq> {}" "0 < card (uverts H)"
[PROOF STATE]
proof (prove)
using this:
real n / 2 \<le> real (card (uverts H))

goal (1 subgoal):
 1. uverts H \<noteq> {} &&& 0 < card (uverts H)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
uverts H \<noteq> {}
0 < card (uverts H)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
uverts H \<noteq> {}
0 < card (uverts H)
[PROOF STEP]
have "0 < \<alpha> H"
[PROOF STATE]
proof (prove)
using this:
uverts H \<noteq> {}
0 < card (uverts H)

goal (1 subgoal):
 1. 0 < \<alpha> H
[PROOF STEP]
using zero_less_\<alpha> uverts_H
[PROOF STATE]
proof (prove)
using this:
uverts H \<noteq> {}
0 < card (uverts H)
uverts ?G \<noteq> {} \<Longrightarrow> 0 < \<alpha> ?G
uverts H \<noteq> {}
0 < card (uverts H)

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

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have \<alpha>_HG: "\<alpha> H \<le> \<alpha> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> H \<le> \<alpha> G
[PROOF STEP]
unfolding H_def G_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> (kill_short (ES.edge_ugraph es) k) \<le> \<alpha> (ES.edge_ugraph es)
[PROOF STEP]
by (auto intro: kill_short_\<alpha>)
[PROOF STATE]
proof (state)
this:
\<alpha> H \<le> \<alpha> G

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have "enat l \<le> ereal k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal_of_enat (enat l) \<le> ereal (real k)
[PROOF STEP]
using \<open>l \<le> k\<close>
[PROOF STATE]
proof (prove)
using this:
l \<le> k

goal (1 subgoal):
 1. ereal_of_enat (enat l) \<le> ereal (real k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal_of_enat (enat l) \<le> ereal (real k)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal_of_enat (enat l) \<le> ereal (real k)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have "\<dots> < (n/2) / \<alpha> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (real k) < ereal (real n / 2) / ereal_of_enat (\<alpha> G)
[PROOF STEP]
using G_props \<open>3 \<le> k\<close>
[PROOF STATE]
proof (prove)
using this:
uverts G = {1..n}
finite (uverts G)
real (short_count G) < real n / 2
ereal_of_enat (\<alpha> G) < ereal (1 / 2 * real n / real k)
3 \<le> k

goal (1 subgoal):
 1. ereal (real k) < ereal (real n / 2) / ereal_of_enat (\<alpha> G)
[PROOF STEP]
by (cases "\<alpha> G") (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
ereal (real k) < ereal (real n / 2) / ereal_of_enat (\<alpha> G)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (real k) < ereal (real n / 2) / ereal_of_enat (\<alpha> G)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have "\<dots> \<le> (n/2) / \<alpha> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (real n / 2) / ereal_of_enat (\<alpha> G) \<le> ereal (real n / 2) / ereal_of_enat (\<alpha> H)
[PROOF STEP]
using \<alpha>_HG \<open>0 < \<alpha> H\<close>
[PROOF STATE]
proof (prove)
using this:
\<alpha> H \<le> \<alpha> G
0 < \<alpha> H

goal (1 subgoal):
 1. ereal (real n / 2) / ereal_of_enat (\<alpha> G) \<le> ereal (real n / 2) / ereal_of_enat (\<alpha> H)
[PROOF STEP]
by (auto simp: ereal_of_enat_pushout intro!: ereal_divide_left_mono)
[PROOF STATE]
proof (state)
this:
ereal (real n / 2) / ereal_of_enat (\<alpha> G) \<le> ereal (real n / 2) / ereal_of_enat (\<alpha> H)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (real n / 2) / ereal_of_enat (\<alpha> G) \<le> ereal (real n / 2) / ereal_of_enat (\<alpha> H)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have "\<dots> \<le> card (uverts H) / \<alpha> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (real n / 2) / ereal_of_enat (\<alpha> H) \<le> ereal (real (card (uverts H))) / ereal_of_enat (\<alpha> H)
[PROOF STEP]
using card_H \<open>0 < \<alpha> H\<close>
[PROOF STATE]
proof (prove)
using this:
real n / 2 \<le> real (card (uverts H))
0 < \<alpha> H

goal (1 subgoal):
 1. ereal (real n / 2) / ereal_of_enat (\<alpha> H) \<le> ereal (real (card (uverts H))) / ereal_of_enat (\<alpha> H)
[PROOF STEP]
by (auto intro!: ereal_divide_right_mono)
[PROOF STATE]
proof (state)
this:
ereal (real n / 2) / ereal_of_enat (\<alpha> H) \<le> ereal (real (card (uverts H))) / ereal_of_enat (\<alpha> H)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (real n / 2) / ereal_of_enat (\<alpha> H) \<le> ereal (real (card (uverts H))) / ereal_of_enat (\<alpha> H)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
have "\<dots> \<le> chromatic_number H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (real (card (uverts H))) / ereal_of_enat (\<alpha> H) \<le> ereal_of_enat (chromatic_number H)
[PROOF STEP]
using uverts_H T1
[PROOF STATE]
proof (prove)
using this:
uverts H \<noteq> {}
0 < card (uverts H)
uwellformed H

goal (1 subgoal):
 1. ereal (real (card (uverts H))) / ereal_of_enat (\<alpha> H) \<le> ereal_of_enat (chromatic_number H)
[PROOF STEP]
by (intro chromatic_lb) auto
[PROOF STATE]
proof (state)
this:
ereal (real (card (uverts H))) / ereal_of_enat (\<alpha> H) \<le> ereal_of_enat (chromatic_number H)

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ereal_of_enat (enat l) < ereal_of_enat (chromatic_number H)
[PROOF STEP]
have T3: "l < chromatic_number H"
[PROOF STATE]
proof (prove)
using this:
ereal_of_enat (enat l) < ereal_of_enat (chromatic_number H)

goal (1 subgoal):
 1. enat l < chromatic_number H
[PROOF STEP]
by (simp del: ereal_of_enat_simps)
[PROOF STATE]
proof (state)
this:
enat l < chromatic_number H

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
from T1 T2 T3
[PROOF STATE]
proof (chain)
picking this:
uwellformed H
enat l < girth H
enat l < chromatic_number H
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
uwellformed H
enat l < girth H
enat l < chromatic_number H

goal (1 subgoal):
 1. \<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<exists>G. uwellformed G \<and> enat l < girth G \<and> enat l < chromatic_number G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ln_add_one_self_le_self2:
  fixes x :: real
  shows "-1 < x \<Longrightarrow> ln (1 + x) \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 < x \<Longrightarrow> ln (1 + x) \<le> x
[PROOF STEP]
by (metis diff_gt_0_iff_gt diff_minus_eq_add exp_ge_add_one_self exp_le_cancel_iff exp_ln minus_less_iff)


[STATEMENT]
lemma sorted_quicksort: "sorted (quicksort xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (quicksort xs)
[PROOF STEP]
by (induct xs rule: quicksort.induct) (auto simp add: sorted_append not_le less_imp_le)