[STATEMENT]
lemma lincomb_union:
  assumes U: "U \<subseteq> carrier V"
      and U'[simp]: "U' \<subseteq> carrier V"
      and disj: "U \<inter> U' = {}"
      and finU: "finite U"
      and finU': "finite U'"
      and a: "a : U \<union> U' \<rightarrow> carrier K"
    shows "lincomb a (U \<union> U') = lincomb a U \<oplus>\<^bsub>V\<^esub> lincomb a U'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a (U \<union> U') = lincomb a U \<oplus>\<^bsub>V\<^esub> lincomb a U'
[PROOF STEP]
using finU U disj a
[PROOF STATE]
proof (prove)
using this:
finite U
U \<subseteq> carrier V
U \<inter> U' = {}
a \<in> U \<union> U' \<rightarrow> carrier K

goal (1 subgoal):
 1. lincomb a (U \<union> U') = lincomb a U \<oplus>\<^bsub>V\<^esub> lincomb a U'
[PROOF STEP]
proof (induct set:finite)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>{} \<subseteq> carrier V; {} \<inter> U' = {}; a \<in> {} \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a ({} \<union> U') = lincomb a {} \<oplus>\<^bsub>V\<^esub> lincomb a U'
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier V; F \<inter> U' = {}; a \<in> F \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (F \<union> U') = lincomb a F \<oplus>\<^bsub>V\<^esub> lincomb a U'; insert x F \<subseteq> carrier V; insert x F \<inter> U' = {}; a \<in> insert x F \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (insert x F \<union> U') = lincomb a (insert x F) \<oplus>\<^bsub>V\<^esub> lincomb a U'
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
{} \<subseteq> carrier V
{} \<inter> U' = {}
a \<in> {} \<union> U' \<rightarrow> carrier K

goal (2 subgoals):
 1. \<lbrakk>{} \<subseteq> carrier V; {} \<inter> U' = {}; a \<in> {} \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a ({} \<union> U') = lincomb a {} \<oplus>\<^bsub>V\<^esub> lincomb a U'
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier V; F \<inter> U' = {}; a \<in> F \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (F \<union> U') = lincomb a F \<oplus>\<^bsub>V\<^esub> lincomb a U'; insert x F \<subseteq> carrier V; insert x F \<inter> U' = {}; a \<in> insert x F \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (insert x F \<union> U') = lincomb a (insert x F) \<oplus>\<^bsub>V\<^esub> lincomb a U'
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
{} \<subseteq> carrier V
{} \<inter> U' = {}
a \<in> {} \<union> U' \<rightarrow> carrier K

goal (1 subgoal):
 1. lincomb a ({} \<union> U') = lincomb a {} \<oplus>\<^bsub>V\<^esub> lincomb a U'
[PROOF STEP]
by (subst(2) lincomb_def, simp)
[PROOF STATE]
proof (state)
this:
lincomb a ({} \<union> U') = lincomb a {} \<oplus>\<^bsub>V\<^esub> lincomb a U'

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier V; F \<inter> U' = {}; a \<in> F \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (F \<union> U') = lincomb a F \<oplus>\<^bsub>V\<^esub> lincomb a U'; insert x F \<subseteq> carrier V; insert x F \<inter> U' = {}; a \<in> insert x F \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (insert x F \<union> U') = lincomb a (insert x F) \<oplus>\<^bsub>V\<^esub> lincomb a U'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier V; F \<inter> U' = {}; a \<in> F \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (F \<union> U') = lincomb a F \<oplus>\<^bsub>V\<^esub> lincomb a U'; insert x F \<subseteq> carrier V; insert x F \<inter> U' = {}; a \<in> insert x F \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (insert x F \<union> U') = lincomb a (insert x F) \<oplus>\<^bsub>V\<^esub> lincomb a U'
[PROOF STEP]
case (insert u U)
[PROOF STATE]
proof (state)
this:
finite U
u \<notin> U
\<lbrakk>U \<subseteq> carrier V; U \<inter> U' = {}; a \<in> U \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (U \<union> U') = lincomb a U \<oplus>\<^bsub>V\<^esub> lincomb a U'
insert u U \<subseteq> carrier V
insert u U \<inter> U' = {}
a \<in> insert u U \<union> U' \<rightarrow> carrier K

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier V; F \<inter> U' = {}; a \<in> F \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (F \<union> U') = lincomb a F \<oplus>\<^bsub>V\<^esub> lincomb a U'; insert x F \<subseteq> carrier V; insert x F \<inter> U' = {}; a \<in> insert x F \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (insert x F \<union> U') = lincomb a (insert x F) \<oplus>\<^bsub>V\<^esub> lincomb a U'
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finite U
u \<notin> U
\<lbrakk>U \<subseteq> carrier V; U \<inter> U' = {}; a \<in> U \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (U \<union> U') = lincomb a U \<oplus>\<^bsub>V\<^esub> lincomb a U'
insert u U \<subseteq> carrier V
insert u U \<inter> U' = {}
a \<in> insert u U \<union> U' \<rightarrow> carrier K

goal (1 subgoal):
 1. lincomb a (insert u U \<union> U') = lincomb a (insert u U) \<oplus>\<^bsub>V\<^esub> lincomb a U'
[PROOF STEP]
unfolding Un_insert_left
[PROOF STATE]
proof (prove)
using this:
finite U
u \<notin> U
\<lbrakk>U \<subseteq> carrier V; U \<inter> U' = {}; a \<in> U \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (U \<union> U') = lincomb a U \<oplus>\<^bsub>V\<^esub> lincomb a U'
insert u U \<subseteq> carrier V
insert u U \<inter> U' = {}
a \<in> insert u (U \<union> U') \<rightarrow> carrier K

goal (1 subgoal):
 1. lincomb a (insert u (U \<union> U')) = lincomb a (insert u U) \<oplus>\<^bsub>V\<^esub> lincomb a U'
[PROOF STEP]
using lincomb_insert2 finU' insert a_assoc
[PROOF STATE]
proof (prove)
using this:
finite U
u \<notin> U
\<lbrakk>U \<subseteq> carrier V; U \<inter> U' = {}; a \<in> U \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (U \<union> U') = lincomb a U \<oplus>\<^bsub>V\<^esub> lincomb a U'
insert u U \<subseteq> carrier V
insert u U \<inter> U' = {}
a \<in> insert u (U \<union> U') \<rightarrow> carrier K
\<lbrakk>finite ?S; ?S \<subseteq> carrier V; ?a \<in> insert ?v ?S \<rightarrow> carrier K; ?v \<notin> ?S; ?v \<in> carrier V\<rbrakk> \<Longrightarrow> lincomb ?a (insert ?v ?S) = ?a ?v \<odot>\<^bsub>V\<^esub> ?v \<oplus>\<^bsub>V\<^esub> lincomb ?a ?S
finite U'
finite U
u \<notin> U
\<lbrakk>U \<subseteq> carrier V; U \<inter> U' = {}; a \<in> U \<union> U' \<rightarrow> carrier K\<rbrakk> \<Longrightarrow> lincomb a (U \<union> U') = lincomb a U \<oplus>\<^bsub>V\<^esub> lincomb a U'
insert u U \<subseteq> carrier V
insert u U \<inter> U' = {}
a \<in> insert u U \<union> U' \<rightarrow> carrier K
\<lbrakk>?x \<in> carrier V; ?y \<in> carrier V; ?z \<in> carrier V\<rbrakk> \<Longrightarrow> ?x \<oplus>\<^bsub>V\<^esub> ?y \<oplus>\<^bsub>V\<^esub> ?z = ?x \<oplus>\<^bsub>V\<^esub> (?y \<oplus>\<^bsub>V\<^esub> ?z)

goal (1 subgoal):
 1. lincomb a (insert u (U \<union> U')) = lincomb a (insert u U) \<oplus>\<^bsub>V\<^esub> lincomb a U'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb a (insert u U \<union> U') = lincomb a (insert u U) \<oplus>\<^bsub>V\<^esub> lincomb a U'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_triangle_half_l:
  fixes y :: "'a::linordered_field"
  assumes "abs (x - y) < e / 2"
    and "abs (x' - y) < e / 2"
  shows "abs (x - x') < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x - x'\<bar> < e
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<bar>x - y\<bar> < e / (2::'a)
\<bar>x' - y\<bar> < e / (2::'a)

goal (1 subgoal):
 1. \<bar>x - x'\<bar> < e
[PROOF STEP]
by linarith


[STATEMENT]
lemma on_circline_cmat_cvec_unit:
  shows "on_circline_cmat_cvec unit_circle_cmat (z1, z2) \<longleftrightarrow>
         z1 * cnj z1 = z2 * cnj z2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. on_circline_cmat_cvec unit_circle_cmat (z1, z2) = (z1 * cnj z1 = z2 * cnj z2)
[PROOF STEP]
by (simp add: vec_cnj_def field_simps)


[STATEMENT]
lemma map_sq_matrix_mult:
  fixes f :: "'a::semiring_1 \<Rightarrow> 'b::semiring_1"
  assumes f: "\<And>a b. f (a + b) = f a + f b" "\<And>a b. f (a * b) = f a * f b" "f 0 = 0"
  shows "map_sq_matrix f (A * B) = map_sq_matrix f A * map_sq_matrix f B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_sq_matrix f (A * B) = map_sq_matrix f A * map_sq_matrix f B
[PROOF STEP]
proof (transfer fixing: f)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A B. (\<lambda>i j. f (\<Sum>k\<in>UNIV. A i k * B k j)) = (\<lambda>i j. \<Sum>k\<in>UNIV. f (A i k) * f (B k j))
[PROOF STEP]
fix A B :: "'c \<Rightarrow> 'c \<Rightarrow> 'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A B. (\<lambda>i j. f (\<Sum>k\<in>UNIV. A i k * B k j)) = (\<lambda>i j. \<Sum>k\<in>UNIV. f (A i k) * f (B k j))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A B. (\<lambda>i j. f (\<Sum>k\<in>UNIV. A i k * B k j)) = (\<lambda>i j. \<Sum>k\<in>UNIV. f (A i k) * f (B k j))
[PROOF STEP]
fix I i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A B. (\<lambda>i j. f (\<Sum>k\<in>UNIV. A i k * B k j)) = (\<lambda>i j. \<Sum>k\<in>UNIV. f (A i k) * f (B k j))
[PROOF STEP]
have "f (\<Sum>k\<in>I. A i k * B k j) = (\<Sum>k\<in>I. f (A i k) * f (B k j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (\<Sum>k\<in>I. A i k * B k j) = (\<Sum>k\<in>I. f (A i k) * f (B k j))
[PROOF STEP]
by (induction I rule: infinite_finite_induct) (auto simp add: f)
[PROOF STATE]
proof (state)
this:
f (\<Sum>k\<in>I. A i k * B k j) = (\<Sum>k\<in>I. f (A i k) * f (B k j))

goal (1 subgoal):
 1. \<And>A B. (\<lambda>i j. f (\<Sum>k\<in>UNIV. A i k * B k j)) = (\<lambda>i j. \<Sum>k\<in>UNIV. f (A i k) * f (B k j))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
f (\<Sum>k\<in>?I2. A ?i2 k * B k ?j2) = (\<Sum>k\<in>?I2. f (A ?i2 k) * f (B k ?j2))

goal (1 subgoal):
 1. \<And>A B. (\<lambda>i j. f (\<Sum>k\<in>UNIV. A i k * B k j)) = (\<lambda>i j. \<Sum>k\<in>UNIV. f (A i k) * f (B k j))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f (\<Sum>k\<in>?I2. A ?i2 k * B k ?j2) = (\<Sum>k\<in>?I2. f (A ?i2 k) * f (B k ?j2))
[PROOF STEP]
show "(\<lambda>i j. f (\<Sum>k\<in>UNIV. A i k * B k j)) = (\<lambda>i j. \<Sum>k\<in>UNIV. f (A i k) * f (B k j))"
[PROOF STATE]
proof (prove)
using this:
f (\<Sum>k\<in>?I2. A ?i2 k * B k ?j2) = (\<Sum>k\<in>?I2. f (A ?i2 k) * f (B k ?j2))

goal (1 subgoal):
 1. (\<lambda>i j. f (\<Sum>k\<in>UNIV. A i k * B k j)) = (\<lambda>i j. \<Sum>k\<in>UNIV. f (A i k) * f (B k j))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>i j. f (\<Sum>k\<in>UNIV. A i k * B k j)) = (\<lambda>i j. \<Sum>k\<in>UNIV. f (A i k) * f (B k j))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dtree_from_list_fcard1_iff_nempty: "fcard (sucs (dtree_from_list r xs)) = 1 \<longleftrightarrow> xs \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fcard (sucs (dtree_from_list r xs)) = 1) = (xs \<noteq> [])
[PROOF STEP]
by(induction xs) (auto simp: fcard_single_1 fcard_fempty)


[STATEMENT]
lemma multiply_by_add2_time: "VARS M N P t :: int
 {m=M \<and> n=N \<and> t=0}
 IF M < 0 THEN M := -M; t := t+1; N := -N; t := t+1 ELSE SKIP FI;
 P := 0; t := t+1;
 WHILE 0 < M
 INV {0 \<le> M & (\<exists>p. p = (if m<0 then -m else m) & p*N = m*n & P = (p-M)*N & t \<ge> 0 & t \<le> 2*(p-M)+3)}
 DO P := P+N; t := t+1; M := M - 1; t := t+1 OD
 {P = m*n & t \<le> 2*abs m + 3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m = M \<and> n = N \<and> t = 0}
IF M < 0 THEN M := - M; t := t + 1; N := - N; t := t + 1  ELSE SKIP FI; P := 0; t := t + 1; WHILE 0 < M INV {0 \<le> M \<and> (\<exists>p. p = (if m < 0 then - m else m) \<and> p * N = m * n \<and> P = (p - M) * N \<and> 0 \<le> t \<and> t \<le> 2 * (p - M) + 3)}  VAR {0}
DO P := P + N; t := t + 1; M := M - 1; t := t + 1 OD
{P = m * n \<and> t \<le> 2 * \<bar>m\<bar> + 3}
[PROOF STEP]
apply vcg_simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>M N t. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 \<le> t \<and> t \<le> 2 * (if m < 0 then - m else m) - 2 * M + 3 \<and> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N + N = (- m - (M - 1)) * N) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N + N = (m - (M - 1)) * N)
 2. \<And>M N t. 0 \<le> M \<and> (if m < 0 then - m else m) * N = m * n \<and> 0 \<le> t \<and> t \<le> 2 * (if m < 0 then - m else m) - 2 * M + 3 \<and> \<not> 0 < M \<Longrightarrow> (m < 0 \<longrightarrow> (- m - M) * N = m * n \<and> t \<le> 3 - 2 * m) \<and> (\<not> m < 0 \<longrightarrow> (m - M) * N = m * n \<and> t \<le> 2 * m + 3)
[PROOF STEP]
apply (auto simp add:int_distrib)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma UNIV_not_singleton_converse:
  assumes"\<And>x::'a. UNIV \<noteq> {x}"
  shows "\<exists>x::'a. \<exists>y. x \<noteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. x \<noteq> y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
UNIV \<noteq> {?x}

goal (1 subgoal):
 1. \<exists>x y. x \<noteq> y
[PROOF STEP]
by fastforce


[STATEMENT]
lemma homotopy_equivalence_homology_group_isomorphism:
  assumes "continuous_map X Y f"
      and "continuous_map Y X g"
      and "homotopic_with (\<lambda>h. True) X X (g \<circ> f) id"
      and "homotopic_with (\<lambda>k. True) Y Y (f \<circ> g) id"
    shows "(hom_induced p X {} Y {} f) \<in> iso (homology_group p X) (homology_group p Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p X {} Y {} f \<in> Group.iso (homology_group p X) (homology_group p Y)
[PROOF STEP]
apply (rule homotopy_equivalence_relative_homology_group_isomorphism)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. continuous_map X Y f
 2. f ` {} \<subseteq> {}
 3. continuous_map Y X ?g
 4. ?g ` {} \<subseteq> {}
 5. homotopic_with (\<lambda>h. h ` {} \<subseteq> {}) X X (?g \<circ> f) id
 6. homotopic_with (\<lambda>k. k ` {} \<subseteq> {}) Y Y (f \<circ> ?g) id
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_map X Y f
continuous_map Y X g
homotopic_with (\<lambda>h. True) X X (g \<circ> f) id
homotopic_with (\<lambda>k. True) Y Y (f \<circ> g) id

goal (6 subgoals):
 1. continuous_map X Y f
 2. f ` {} \<subseteq> {}
 3. continuous_map Y X ?g
 4. ?g ` {} \<subseteq> {}
 5. homotopic_with (\<lambda>h. h ` {} \<subseteq> {}) X X (?g \<circ> f) id
 6. homotopic_with (\<lambda>k. k ` {} \<subseteq> {}) Y Y (f \<circ> ?g) id
[PROOF STEP]
by auto


[STATEMENT]
lemma dioid_sum_prod_var:
  fixes f g :: "'a \<Rightarrow> 'b::dioid_one_zero"
  assumes "finite (A ::'a set)"
  shows "(\<Sum>(f ` A)) \<cdot> (\<Sum> (g ` A)) = \<Sum>{f x \<cdot> g y |x y. x \<in> A \<and> y \<in> A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> (f ` A) \<cdot> \<Sum> (g ` A) = \<Sum> {f x \<cdot> g y |x y. x \<in> A \<and> y \<in> A}
[PROOF STEP]
by (simp add: assms sum_dist fprod_aux)


[STATEMENT]
lemma gbinomial_pochhammer: "a gchoose k = (- 1) ^ k * pochhammer (- a) k / fact k"
  for a :: "'a::field_char_0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a gchoose k = (- (1::'a)) ^ k * pochhammer (- a) k / fact k
[PROOF STEP]
proof (cases k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> a gchoose k = (- (1::'a)) ^ k * pochhammer (- a) k / fact k
 2. \<And>nat. k = Suc nat \<Longrightarrow> a gchoose k = (- (1::'a)) ^ k * pochhammer (- a) k / fact k
[PROOF STEP]
case (Suc k')
[PROOF STATE]
proof (state)
this:
k = Suc k'

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> a gchoose k = (- (1::'a)) ^ k * pochhammer (- a) k / fact k
 2. \<And>nat. k = Suc nat \<Longrightarrow> a gchoose k = (- (1::'a)) ^ k * pochhammer (- a) k / fact k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = Suc k'
[PROOF STEP]
have "a gchoose k = pochhammer (a - of_nat k') (Suc k') / ((1 + of_nat k') * fact k')"
[PROOF STATE]
proof (prove)
using this:
k = Suc k'

goal (1 subgoal):
 1. a gchoose k = pochhammer (a - of_nat k') (Suc k') / (((1::'a) + of_nat k') * fact k')
[PROOF STEP]
by (simp add: gbinomial_prod_rev pochhammer_prod_rev atLeastLessThanSuc_atLeastAtMost
        prod.atLeast_Suc_atMost_Suc_shift of_nat_diff flip: power_mult_distrib prod.cl_ivl_Suc)
[PROOF STATE]
proof (state)
this:
a gchoose k = pochhammer (a - of_nat k') (Suc k') / (((1::'a) + of_nat k') * fact k')

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> a gchoose k = (- (1::'a)) ^ k * pochhammer (- a) k / fact k
 2. \<And>nat. k = Suc nat \<Longrightarrow> a gchoose k = (- (1::'a)) ^ k * pochhammer (- a) k / fact k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a gchoose k = pochhammer (a - of_nat k') (Suc k') / (((1::'a) + of_nat k') * fact k')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a gchoose k = pochhammer (a - of_nat k') (Suc k') / (((1::'a) + of_nat k') * fact k')

goal (1 subgoal):
 1. a gchoose k = (- (1::'a)) ^ k * pochhammer (- a) k / fact k
[PROOF STEP]
by (simp add: pochhammer_minus Suc)
[PROOF STATE]
proof (state)
this:
a gchoose k = (- (1::'a)) ^ k * pochhammer (- a) k / fact k

goal (1 subgoal):
 1. k = 0 \<Longrightarrow> a gchoose k = (- (1::'a)) ^ k * pochhammer (- a) k / fact k
[PROOF STEP]
qed auto


[STATEMENT]
lemma Ims''m_calc:
  "$(I^{m}s'')^{m}_n =
    (1+i).^(1/m) * ((1+i).^(n+1/m) - (n*m+1)*(1+i).^(1/m) + n*m) / (m*((1+i).^(1/m)-1))^2"
  if "i \<noteq> 0" "m \<noteq> 0" for n m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $(I^{m}s'')^{m}_n = (1 + i) .^ (1 / real m) * ((1 + i) .^ (real n + 1 / real m) - real (n * m + 1) * (1 + i) .^ (1 / real m) + real (n * m)) / (real m * ((1 + i) .^ (1 / real m) - 1))\<^sup>2
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
i \<noteq> 0
m \<noteq> 0

goal (1 subgoal):
 1. $(I^{m}s'')^{m}_n = (1 + i) .^ (1 / real m) * ((1 + i) .^ (real n + 1 / real m) - real (n * m + 1) * (1 + i) .^ (1 / real m) + real (n * m)) / (real m * ((1 + i) .^ (1 / real m) - 1))\<^sup>2
[PROOF STEP]
by (simp add: Ils''m_Ilsm Imsm_calc)


[STATEMENT]
lemma eigen_value_root_charpoly:
  "eigen_value A k \<longleftrightarrow> poly (charpoly (A :: 'a :: field ^ 'n ^ 'n)) k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigen_value A k = (poly (charpoly A) k = (0::'a))
[PROOF STEP]
by (transfer_hma rule: eigenvalue_root_char_poly)


[STATEMENT]
lemma fpower_inductl:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  shows "mono f \<Longrightarrow> mono g \<Longrightarrow> h \<le> g \<sqinter> (f \<circ> h) \<Longrightarrow> h \<le> fpower f i \<circ> g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; mono g; h \<le> g \<sqinter> (f \<circ> h)\<rbrakk> \<Longrightarrow> h \<le> fpower f i \<circ> g
[PROOF STEP]
apply (induct i, simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>h \<le> fpower f i \<circ> g; mono f; mono g; h \<le> g \<and> h \<le> f \<circ> h\<rbrakk> \<Longrightarrow> h \<le> f \<circ> fpower f i \<circ> g
[PROOF STEP]
by (metis (no_types, opaque_lifting) fun.map_comp fun_isol order_trans)


[STATEMENT]
lemma dual_INF: "(\<Sqinter>(f ` A)) ^ o = (SUP a \<in> A . (f a) ^ o)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> (f ` A) ^ o = (\<Squnion>a\<in>A. f a ^ o)
[PROOF STEP]
unfolding Inf_comp dual_Inf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> (dual ` f ` A) = (\<Squnion>a\<in>A. f a ^ o)
[PROOF STEP]
apply (subgoal_tac "(dual ` f ` A) = ((\<lambda>a::'b. f a ^ o) ` A)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dual ` f ` A = (\<lambda>a. f a ^ o) ` A \<Longrightarrow> \<Squnion> (dual ` f ` A) = (\<Squnion>a\<in>A. f a ^ o)
 2. dual ` f ` A = (\<lambda>a. f a ^ o) ` A
[PROOF STEP]
by auto


[STATEMENT]
theorem effective_matrix_tensor_elements:
  " (((i<((row_length M1)*(row_length M2)))
  \<and>(j < (length M1)*(length M2)))
  \<and>(mat (row_length M1) (length M1) M1)
  \<and>(mat (row_length M2) (length M2) M2)
 \<Longrightarrow> ((M1 \<otimes> M2)!j!i)
   = f (M1!(j div (length M2))!(i div (row_length M2)))
       (M2!(j mod length M2)!(i mod (row_length M2))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i < row_length M1 * row_length M2 \<and> j < length M1 * length M2) \<and> mat (row_length M1) (length M1) M1 \<and> mat (row_length M2) (length M2) M2 \<Longrightarrow> (M1 \<otimes> M2) ! j ! i = M1 ! (j div length M2) ! (i div row_length M2) * M2 ! (j mod length M2) ! (i mod row_length M2)
[PROOF STEP]
using matrix_Tensor_elements
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. (i < row_length ?M1.0 * row_length ?M2.0 \<and> j < length ?M1.0 * length ?M2.0) \<and> mat (row_length ?M1.0) (length ?M1.0) ?M1.0 \<and> mat (row_length ?M2.0) (length ?M2.0) ?M2.0 \<longrightarrow> (?M1.0 \<otimes> ?M2.0) ! j ! i = ?M1.0 ! (j div length ?M2.0) ! (i div row_length ?M2.0) * ?M2.0 ! (j mod length ?M2.0) ! (i mod row_length ?M2.0)

goal (1 subgoal):
 1. (i < row_length M1 * row_length M2 \<and> j < length M1 * length M2) \<and> mat (row_length M1) (length M1) M1 \<and> mat (row_length M2) (length M2) M2 \<Longrightarrow> (M1 \<otimes> M2) ! j ! i = M1 ! (j div length M2) ! (i div row_length M2) * M2 ! (j mod length M2) ! (i mod row_length M2)
[PROOF STEP]
by auto


[STATEMENT]
theorem (in prime_number_theorem) limsup_divisor_count:
  "limsup (\<lambda>n. ln (divisor_count n) * ln (ln n) / ln n) = ln 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) = ereal (ln 2)
[PROOF STEP]
proof (intro antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
 2. ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
let ?h = "primorial'"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
 2. ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
have "2 ^ k = (1 :: real) \<longleftrightarrow> k = 0" for k :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ k = 1) = (k = 0)
[PROOF STEP]
using power_eq_1_iff[of "2::real" k]
[PROOF STATE]
proof (prove)
using this:
2 ^ k = 1 \<Longrightarrow> norm 2 = 1 \<or> k = 0

goal (1 subgoal):
 1. (2 ^ k = 1) = (k = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 ^ ?k = 1) = (?k = 0)

goal (2 subgoals):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
 2. ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
hence "(\<lambda>k. ln (divisor_count (?h k)) / (ln 2 * ln (?h k) / ln (ln (?h k)))) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
using this:
(2 ^ ?k = 1) = (?k = 0)

goal (1 subgoal):
 1. (\<lambda>k. ln (real (divisor_count (primorial' k))) / (ln 2 * ln (real (primorial' k)) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> 1
[PROOF STEP]
using ln_divisor_count_primorial'_asymp_equiv
[PROOF STATE]
proof (prove)
using this:
(2 ^ ?k = 1) = (?k = 0)
(\<lambda>k. ln (real (divisor_count (primorial' k)))) \<sim>[sequentially] (\<lambda>k. ln 2 * ln (real (primorial' k)) / ln (ln (real (primorial' k))))

goal (1 subgoal):
 1. (\<lambda>k. ln (real (divisor_count (primorial' k))) / (ln 2 * ln (real (primorial' k)) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> 1
[PROOF STEP]
by (intro asymp_equivD_strong eventually_mono[OF eventually_gt_at_top[of 1]])
       (auto simp: power_eq_1_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. ln (real (divisor_count (primorial' k))) / (ln 2 * ln (real (primorial' k)) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> 1

goal (2 subgoals):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
 2. ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
hence "(\<lambda>k. ln (divisor_count (?h k)) / (ln 2 * ln (?h k) / ln (ln (?h k))) * ln 2) \<longlonglongrightarrow> 1 * ln 2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. ln (real (divisor_count (primorial' k))) / (ln 2 * ln (real (primorial' k)) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. (\<lambda>k. ln (real (divisor_count (primorial' k))) / (ln 2 * ln (real (primorial' k)) / ln (ln (real (primorial' k)))) * ln 2) \<longlonglongrightarrow> 1 * ln 2
[PROOF STEP]
by (rule tendsto_mult) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>k. ln (real (divisor_count (primorial' k))) / (ln 2 * ln (real (primorial' k)) / ln (ln (real (primorial' k)))) * ln 2) \<longlonglongrightarrow> 1 * ln 2

goal (2 subgoals):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
 2. ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
hence "(\<lambda>k. ln (divisor_count (?h k)) / (ln (?h k) / ln (ln (?h k)))) \<longlonglongrightarrow> ln 2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. ln (real (divisor_count (primorial' k))) / (ln 2 * ln (real (primorial' k)) / ln (ln (real (primorial' k)))) * ln 2) \<longlonglongrightarrow> 1 * ln 2

goal (1 subgoal):
 1. (\<lambda>k. ln (real (divisor_count (primorial' k))) / (ln (real (primorial' k)) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> ln 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>k. ln (real (divisor_count (primorial' k))) / (ln (real (primorial' k)) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> ln 2

goal (2 subgoals):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
 2. ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
hence "limsup ((\<lambda>n. ln (divisor_count n) * ln (ln n) / ln n) \<circ> primorial') = ereal (ln 2)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. ln (real (divisor_count (primorial' k))) / (ln (real (primorial' k)) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> ln 2

goal (1 subgoal):
 1. limsup (\<lambda>x. ereal (((\<lambda>n. ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n)) \<circ> primorial') x)) = ereal (ln 2)
[PROOF STEP]
by (intro lim_imp_Limsup tendsto_ereal) simp_all
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>x. ereal (((\<lambda>n. ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n)) \<circ> primorial') x)) = ereal (ln 2)

goal (2 subgoals):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
 2. ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
hence "ln 2 = limsup ((\<lambda>n. ereal (ln (divisor_count n) * ln (ln n) / ln n)) \<circ> primorial')"
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>x. ereal (((\<lambda>n. ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n)) \<circ> primorial') x)) = ereal (ln 2)

goal (1 subgoal):
 1. ereal (ln 2) = limsup ((\<lambda>n. ereal (ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n))) \<circ> primorial')
[PROOF STEP]
by (simp add: o_def)
[PROOF STATE]
proof (state)
this:
ereal (ln 2) = limsup ((\<lambda>n. ereal (ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n))) \<circ> primorial')

goal (2 subgoals):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
 2. ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (ln 2) = limsup ((\<lambda>n. ereal (ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n))) \<circ> primorial')

goal (2 subgoals):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
 2. ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
have "\<dots> \<le> limsup (\<lambda>n. ln (divisor_count n) * ln (ln n) / ln n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup ((\<lambda>n. ereal (ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n))) \<circ> primorial') \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
using strict_mono_primorial'
[PROOF STATE]
proof (prove)
using this:
strict_mono primorial'

goal (1 subgoal):
 1. limsup ((\<lambda>n. ereal (ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n))) \<circ> primorial') \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
by (rule limsup_subseq_mono)
[PROOF STATE]
proof (state)
this:
limsup ((\<lambda>n. ereal (ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n))) \<circ> primorial') \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))

goal (2 subgoals):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
 2. ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
show "limsup (\<lambda>n. ln (divisor_count n) * ln (ln n) / ln n) \<ge> ln 2"
[PROOF STATE]
proof (prove)
using this:
ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))

goal (1 subgoal):
 1. ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ereal (ln 2) \<le> limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)))

goal (1 subgoal):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
[PROOF STEP]
show "limsup (\<lambda>n. ln (divisor_count n) * ln (ln n) / ln n) \<le> ln 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)
[PROOF STEP]
unfolding Limsup_le_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y>ereal (ln 2). \<forall>\<^sub>F x in sequentially. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)) < y
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. ereal (ln 2) < y \<Longrightarrow> \<forall>\<^sub>F x in sequentially. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)) < y
[PROOF STEP]
fix C'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. ereal (ln 2) < y \<Longrightarrow> \<forall>\<^sub>F x in sequentially. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)) < y
[PROOF STEP]
assume "C' > ereal (ln 2)"
[PROOF STATE]
proof (state)
this:
ereal (ln 2) < C'

goal (1 subgoal):
 1. \<And>y. ereal (ln 2) < y \<Longrightarrow> \<forall>\<^sub>F x in sequentially. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)) < y
[PROOF STEP]
from ereal_dense2[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. ereal (ln 2) < ereal z \<and> ereal z < C'
[PROOF STEP]
obtain C where C: "C > ln 2" "ereal C < C'"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. ereal (ln 2) < ereal z \<and> ereal z < C'

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>ln 2 < C; ereal C < C'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ln 2 < C
ereal C < C'

goal (1 subgoal):
 1. \<And>y. ereal (ln 2) < y \<Longrightarrow> \<forall>\<^sub>F x in sequentially. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)) < y
[PROOF STEP]
define \<epsilon> where "\<epsilon> = (C / ln 2) - 1"
[PROOF STATE]
proof (state)
this:
\<epsilon> = C / ln 2 - 1

goal (1 subgoal):
 1. \<And>y. ereal (ln 2) < y \<Longrightarrow> \<forall>\<^sub>F x in sequentially. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)) < y
[PROOF STEP]
from C
[PROOF STATE]
proof (chain)
picking this:
ln 2 < C
ereal C < C'
[PROOF STEP]
have "\<epsilon> > 0"
[PROOF STATE]
proof (prove)
using this:
ln 2 < C
ereal C < C'

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

goal (1 subgoal):
 1. \<And>y. ereal (ln 2) < y \<Longrightarrow> \<forall>\<^sub>F x in sequentially. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)) < y
[PROOF STEP]
have "eventually (\<lambda>n::nat. ln (ln n) > 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < ln (ln (real n))
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < ln (ln (real n))

goal (1 subgoal):
 1. \<And>y. ereal (ln 2) < y \<Longrightarrow> \<forall>\<^sub>F x in sequentially. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)) < y
[PROOF STEP]
hence "eventually (\<lambda>n. ln (divisor_count n) * ln (ln n) / ln n < C) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < ln (ln (real n))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
using divisor_count_upper_bound[OF \<open>\<epsilon> > 0\<close>] eventually_gt_at_top[of 1]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < ln (ln (real n))
\<forall>\<^sub>F n in sequentially. real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n)))
eventually ((<) (1::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n))); 1 < n\<rbrakk> \<Longrightarrow> ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
case (elim n)
[PROOF STATE]
proof (state)
this:
0 < ln (ln (real n))
real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n)))
1 < n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n))); 1 < n\<rbrakk> \<Longrightarrow> ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
hence "ln (divisor_count n) < ln (2 powr ((1 + \<epsilon>) * ln n / ln (ln n)))"
[PROOF STATE]
proof (prove)
using this:
0 < ln (ln (real n))
real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n)))
1 < n

goal (1 subgoal):
 1. ln (real (divisor_count n)) < ln (2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n))))
[PROOF STEP]
by (subst ln_less_cancel_iff) auto
[PROOF STATE]
proof (state)
this:
ln (real (divisor_count n)) < ln (2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n))))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n))); 1 < n\<rbrakk> \<Longrightarrow> ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (real (divisor_count n)) < ln (2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n))))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n))); 1 < n\<rbrakk> \<Longrightarrow> ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
have "\<dots> = (1 + \<epsilon>) * ln 2 * ln n / ln (ln n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n)))) = (1 + \<epsilon>) * ln 2 * ln (real n) / ln (ln (real n))
[PROOF STEP]
by (simp add: ln_powr)
[PROOF STATE]
proof (state)
this:
ln (2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n)))) = (1 + \<epsilon>) * ln 2 * ln (real n) / ln (ln (real n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n))); 1 < n\<rbrakk> \<Longrightarrow> ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (real (divisor_count n)) < (1 + \<epsilon>) * ln 2 * ln (real n) / ln (ln (real n))
[PROOF STEP]
have "ln (divisor_count n) * ln (ln n) / ln n < (1 + \<epsilon>) * ln 2"
[PROOF STATE]
proof (prove)
using this:
ln (real (divisor_count n)) < (1 + \<epsilon>) * ln 2 * ln (real n) / ln (ln (real n))

goal (1 subgoal):
 1. ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < (1 + \<epsilon>) * ln 2
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
ln (real (divisor_count n)) < (1 + \<epsilon>) * ln 2 * ln (real n) / ln (ln (real n))
0 < ln (ln (real n))
real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n)))
1 < n

goal (1 subgoal):
 1. ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < (1 + \<epsilon>) * ln 2
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < (1 + \<epsilon>) * ln 2

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n))); 1 < n\<rbrakk> \<Longrightarrow> ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < (1 + \<epsilon>) * ln 2

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n))); 1 < n\<rbrakk> \<Longrightarrow> ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
have "\<dots> = C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + \<epsilon>) * ln 2 = C
[PROOF STEP]
by (simp add: \<epsilon>_def)
[PROOF STATE]
proof (state)
this:
(1 + \<epsilon>) * ln 2 = C

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); real (divisor_count n) < 2 powr ((1 + \<epsilon>) * ln (real n) / ln (ln (real n))); 1 < n\<rbrakk> \<Longrightarrow> ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C

goal (1 subgoal):
 1. ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C

goal (1 subgoal):
 1. \<And>y. ereal (ln 2) < y \<Longrightarrow> \<forall>\<^sub>F x in sequentially. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x)) < y
[PROOF STEP]
thus "eventually (\<lambda>n. ereal (ln (divisor_count n) * ln (ln n) / ln n) < C') at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n) < C

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ereal (ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n)) < C'
[PROOF STEP]
by eventually_elim (rule less_trans[OF _ C(2)], auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ereal (ln (real (divisor_count n)) * ln (ln (real n)) / ln (real n)) < C'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>x. ereal (ln (real (divisor_count x)) * ln (ln (real x)) / ln (real x))) \<le> ereal (ln 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma surj_uni_samp_plus:
  assumes inj: "inj_on  (\<lambda>(b :: nat). (y + b) mod q ) {..<q}"
  shows "(\<lambda>(b :: nat). (y + b) mod q) ` {..< q} =  {..< q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>b. (y + b) mod q) ` {..<q} = {..<q}
[PROOF STEP]
apply(rule endo_inj_surj)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {..<q}
 2. (\<lambda>b. (y + b) mod q) ` {..<q} \<subseteq> {..<q}
 3. inj_on (\<lambda>b. (y + b) mod q) {..<q}
[PROOF STEP]
using inj
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>b. (y + b) mod q) {..<q}

goal (3 subgoals):
 1. finite {..<q}
 2. (\<lambda>b. (y + b) mod q) ` {..<q} \<subseteq> {..<q}
 3. inj_on (\<lambda>b. (y + b) mod q) {..<q}
[PROOF STEP]
by auto


[STATEMENT]
lemma has_integral_Fejer_kernel_half:
  "has_bochner_integral (lebesgue_on {0..pi}) (Fejer_kernel n) (if n = 0 then 0 else pi/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {0..pi}) (Fejer_kernel n) (if n = 0 then 0 else pi / 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {0..pi}) (Fejer_kernel n) (if n = 0 then 0 else pi / 2)
[PROOF STEP]
have "has_bochner_integral (lebesgue_on {0..pi}) (\<lambda>x. (\<Sum>r<n. Dirichlet_kernel r x) / real n) ((\<Sum>r<n. pi/2) / n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {0..pi}) (\<lambda>x. (\<Sum>r<n. Dirichlet_kernel r x) / real n) ((\<Sum>r<n. pi / 2) / real n)
[PROOF STEP]
apply (intro has_bochner_integral_sum has_bochner_integral_divide)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. r \<in> {..<n} \<Longrightarrow> has_bochner_integral (lebesgue_on {0..pi}) (Dirichlet_kernel r) (pi / 2)
[PROOF STEP]
using not_integrable_integral_eq
[PROOF STATE]
proof (prove)
using this:
\<not> integrable ?M ?f \<Longrightarrow> integral\<^sup>L ?M ?f = (0::?'b)

goal (1 subgoal):
 1. \<And>r. r \<in> {..<n} \<Longrightarrow> has_bochner_integral (lebesgue_on {0..pi}) (Dirichlet_kernel r) (pi / 2)
[PROOF STEP]
by (force simp: has_bochner_integral_iff)
[PROOF STATE]
proof (state)
this:
has_bochner_integral (lebesgue_on {0..pi}) (\<lambda>x. (\<Sum>r<n. Dirichlet_kernel r x) / real n) ((\<Sum>r<n. pi / 2) / real n)

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {0..pi}) (Fejer_kernel n) (if n = 0 then 0 else pi / 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
has_bochner_integral (lebesgue_on {0..pi}) (\<lambda>x. (\<Sum>r<n. Dirichlet_kernel r x) / real n) ((\<Sum>r<n. pi / 2) / real n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral (lebesgue_on {0..pi}) (\<lambda>x. (\<Sum>r<n. Dirichlet_kernel r x) / real n) ((\<Sum>r<n. pi / 2) / real n)

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {0..pi}) (Fejer_kernel n) (if n = 0 then 0 else pi / 2)
[PROOF STEP]
by (auto simp: Fejer_kernel_def)
[PROOF STATE]
proof (state)
this:
has_bochner_integral (lebesgue_on {0..pi}) (Fejer_kernel n) (if n = 0 then 0 else pi / 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Transset_INT: "(\<And>x. x \<in> A \<Longrightarrow> Transset (B x)) \<Longrightarrow> Transset (\<Sqinter> (B ` A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> Transset (B x)) \<Longrightarrow> Transset (\<Sqinter> (B ` A))
[PROOF STEP]
by (metis Transset_Inf imageE)


[STATEMENT]
lemma permutations_of_list:
    "permutations_of_set (set xs) = set (permutations_of_set_list (remdups xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutations_of_set (set xs) = set (permutations_of_set_list (remdups xs))
[PROOF STEP]
by (simp add: permutations_of_set_aux_correct [symmetric]
        permutations_of_set_aux_list_refine permutations_of_set_list_def)


[STATEMENT]
lemma inorder_node31: "height m > 0 \<Longrightarrow>
  inorder (treeD (node31 l' a m b r)) = inorder (treeD l') @ a # inorder m @ b # inorder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < height m \<Longrightarrow> inorder (treeD (node31 l' a m b r)) = inorder (treeD l') @ a # inorder m @ b # inorder r
[PROOF STEP]
by(induct l' a m b r rule: node31.induct) auto


[STATEMENT]
lemma card_bijections_range_permutation_eq_0:
  assumes "card A \<noteq> card B"
  shows "card ({f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B) = 0
[PROOF STEP]
using bij_betw_quotient_range_permutation_eq_empty[OF assms]
[PROOF STATE]
proof (prove)
using this:
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B = {}

goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B) = 0
[PROOF STEP]
by (simp only: card.empty)


[STATEMENT]
lemma cartesian_product_binary_union_right:
  assumes "C \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  assumes "D \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  shows "cartesian_product A (C \<union> D) = (cartesian_product A C) \<union> (cartesian_product A D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A (C \<union> D) = cartesian_product A C \<union> cartesian_product A D
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. cartesian_product A (C \<union> D) \<subseteq> cartesian_product A C \<union> cartesian_product A D
 2. cartesian_product A C \<union> cartesian_product A D \<subseteq> cartesian_product A (C \<union> D)
[PROOF STEP]
show "cartesian_product A (C \<union> D) \<subseteq> cartesian_product A C \<union> cartesian_product A D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A (C \<union> D) \<subseteq> cartesian_product A C \<union> cartesian_product A D
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. \<exists>as\<in>A. \<exists>bs\<in>C \<union> D. xs = as @ bs} \<subseteq> {xs. \<exists>as\<in>A. \<exists>bs\<in>C. xs = as @ bs} \<union> {xs. \<exists>as\<in>A. \<exists>bs\<in>D. xs = as @ bs}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cartesian_product A (C \<union> D) \<subseteq> cartesian_product A C \<union> cartesian_product A D

goal (1 subgoal):
 1. cartesian_product A C \<union> cartesian_product A D \<subseteq> cartesian_product A (C \<union> D)
[PROOF STEP]
show "cartesian_product A C \<union> cartesian_product A D \<subseteq> cartesian_product A (C \<union> D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A C \<union> cartesian_product A D \<subseteq> cartesian_product A (C \<union> D)
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. \<exists>as\<in>A. \<exists>bs\<in>C. xs = as @ bs} \<union> {xs. \<exists>as\<in>A. \<exists>bs\<in>D. xs = as @ bs} \<subseteq> {xs. \<exists>as\<in>A. \<exists>bs\<in>C \<union> D. xs = as @ bs}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cartesian_product A C \<union> cartesian_product A D \<subseteq> cartesian_product A (C \<union> D)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homotopy_equivalence_reduced_homology_group_isomorphism:
  assumes "continuous_map X Y f" "continuous_map Y X g"
      and "homotopic_with (\<lambda>h. True) X X (g \<circ> f) id" "homotopic_with (\<lambda>k. True) Y Y (f \<circ> g) id"
  shows "(hom_induced p X {} Y {} f)
          \<in> iso (reduced_homology_group p X) (reduced_homology_group p Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p X {} Y {} f \<in> Group.iso (reduced_homology_group p X) (reduced_homology_group p Y)
[PROOF STEP]
proof (rule group_isomorphisms_imp_iso)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. group_isomorphisms (reduced_homology_group p X) (reduced_homology_group p Y) (hom_induced p X {} Y {} f) ?g
[PROOF STEP]
show "group_isomorphisms (reduced_homology_group p X) (reduced_homology_group p Y)
         (hom_induced p X {} Y {} f) (hom_induced p Y {} X {} g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_isomorphisms (reduced_homology_group p X) (reduced_homology_group p Y) (hom_induced p X {} Y {} f) (hom_induced p Y {} X {} g)
[PROOF STEP]
by (simp add: assms homotopy_equivalence_reduced_homology_group_isomorphisms)
[PROOF STATE]
proof (state)
this:
group_isomorphisms (reduced_homology_group p X) (reduced_homology_group p Y) (hom_induced p X {} Y {} f) (hom_induced p Y {} X {} g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_Sigma:
  assumes defined: "y \<in> Pi T X"
  assumes f_cont: "continuous_on (Sigma T X) (\<lambda>(t, x). f t x)"
  assumes y_cont: "continuous_on T y"
  shows "continuous_on T (\<lambda>x. f x (y x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on T (\<lambda>x. f x (y x))
[PROOF STEP]
using
    defined
    continuous_on_compose2[OF
      continuous_on_subset[where t="(\<lambda>x. (x, y x)) ` T", OF f_cont]
      continuous_on_Pair[OF continuous_on_id y_cont]]
[PROOF STATE]
proof (prove)
using this:
y \<in> Pi T X
\<lbrakk>(\<lambda>x. (x, y x)) ` T \<subseteq> Sigma T X; (\<lambda>x. (x, y x)) ` T \<subseteq> (\<lambda>x. (x, y x)) ` T\<rbrakk> \<Longrightarrow> continuous_on T (\<lambda>x. case (x, y x) of (t, x) \<Rightarrow> f t x)

goal (1 subgoal):
 1. continuous_on T (\<lambda>x. f x (y x))
[PROOF STEP]
by auto


[STATEMENT]
lemma hnorm_divide: "\<And>a b::'a::{real_normed_field, field} star. hnorm (a / b) = hnorm a / hnorm b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. hnorm (a / b) = hnorm a / hnorm b
[PROOF STEP]
by transfer (rule norm_divide)


[STATEMENT]
lemma cis_add_cis_opposite [simp]:
  shows "cis \<phi> + cis (-\<phi>) = 2 * cos \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis \<phi> + cis (- \<phi>) = cor (2 * cos \<phi>)
[PROOF STEP]
by (metis cis.sel(1) cis_cnj complex_add_cnj)


[STATEMENT]
lemma extract_var_code[code]:
  "extract_var p v =
     (\<Sum>m\<in>monomials p. monom (remove_key v m) (monom (Poly_Mapping.single
v (lookup m v)) (coeff p m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extract_var p v = (\<Sum>m\<in>monomials p. monom (remove_key v m) (monom (monomial (lookup m v) v) (coeff p m)))
[PROOF STEP]
apply (rule extract_var_finite_set[where S="monomials p"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {m'. coeff p m' \<noteq> (0::'a)} \<subseteq> monomials p
 2. finite (monomials p)
[PROOF STEP]
using coeff_not_in_monomials
[PROOF STATE]
proof (prove)
using this:
?x \<notin> monomials ?m \<Longrightarrow> coeff ?m ?x = (0::?'a)

goal (2 subgoals):
 1. {m'. coeff p m' \<noteq> (0::'a)} \<subseteq> monomials p
 2. finite (monomials p)
[PROOF STEP]
by auto


[STATEMENT]
lemma of_real_sqrt: "x \<ge> 0 \<Longrightarrow> of_real (sqrt x) = csqrt (of_real x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> complex_of_real (sqrt x) = csqrt (complex_of_real x)
[PROOF STEP]
by (simp add: complex_eq_iff norm_complex_def)


[STATEMENT]
lemma union_grouped_by_fst:
  "(\<Union>xs \<in> set (grouped_by_fst ys). set xs) = set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (sset (grouped_by_fst ys)) = set ys
[PROOF STEP]
by (auto simp: grouped_by_fst_def)


[STATEMENT]
lemma continuous_map_Euclidean_space_iff:
  "continuous_map (Euclidean_space m) euclidean g
   = continuous_on (topspace (Euclidean_space m)) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (Euclidean_space m) euclidean g = continuous_on (topspace (Euclidean_space m)) g
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_map (Euclidean_space m) euclidean g \<Longrightarrow> continuous_on (topspace (Euclidean_space m)) g
 2. continuous_on (topspace (Euclidean_space m)) g \<Longrightarrow> continuous_map (Euclidean_space m) euclidean g
[PROOF STEP]
assume "continuous_map (Euclidean_space m) euclidean g"
[PROOF STATE]
proof (state)
this:
continuous_map (Euclidean_space m) euclidean g

goal (2 subgoals):
 1. continuous_map (Euclidean_space m) euclidean g \<Longrightarrow> continuous_on (topspace (Euclidean_space m)) g
 2. continuous_on (topspace (Euclidean_space m)) g \<Longrightarrow> continuous_map (Euclidean_space m) euclidean g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_map (Euclidean_space m) euclidean g
[PROOF STEP]
have "continuous_map (top_of_set {f. \<forall>n\<ge>m. f n = 0}) euclidean g"
[PROOF STATE]
proof (prove)
using this:
continuous_map (Euclidean_space m) euclidean g

goal (1 subgoal):
 1. continuous_map (top_of_set {f. \<forall>n\<ge>m. f n = 0}) euclidean g
[PROOF STEP]
by (simp add: Euclidean_space_def euclidean_product_topology)
[PROOF STATE]
proof (state)
this:
continuous_map (top_of_set {f. \<forall>n\<ge>m. f n = 0}) euclidean g

goal (2 subgoals):
 1. continuous_map (Euclidean_space m) euclidean g \<Longrightarrow> continuous_on (topspace (Euclidean_space m)) g
 2. continuous_on (topspace (Euclidean_space m)) g \<Longrightarrow> continuous_map (Euclidean_space m) euclidean g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_map (top_of_set {f. \<forall>n\<ge>m. f n = 0}) euclidean g
[PROOF STEP]
show "continuous_on (topspace (Euclidean_space m)) g"
[PROOF STATE]
proof (prove)
using this:
continuous_map (top_of_set {f. \<forall>n\<ge>m. f n = 0}) euclidean g

goal (1 subgoal):
 1. continuous_on (topspace (Euclidean_space m)) g
[PROOF STEP]
by (metis continuous_map_subtopology_eu subtopology_topspace topspace_Euclidean_space)
[PROOF STATE]
proof (state)
this:
continuous_on (topspace (Euclidean_space m)) g

goal (1 subgoal):
 1. continuous_on (topspace (Euclidean_space m)) g \<Longrightarrow> continuous_map (Euclidean_space m) euclidean g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on (topspace (Euclidean_space m)) g \<Longrightarrow> continuous_map (Euclidean_space m) euclidean g
[PROOF STEP]
assume "continuous_on (topspace (Euclidean_space m)) g"
[PROOF STATE]
proof (state)
this:
continuous_on (topspace (Euclidean_space m)) g

goal (1 subgoal):
 1. continuous_on (topspace (Euclidean_space m)) g \<Longrightarrow> continuous_map (Euclidean_space m) euclidean g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on (topspace (Euclidean_space m)) g
[PROOF STEP]
have "continuous_map (top_of_set {f. \<forall>n\<ge>m. f n = 0}) euclidean g"
[PROOF STATE]
proof (prove)
using this:
continuous_on (topspace (Euclidean_space m)) g

goal (1 subgoal):
 1. continuous_map (top_of_set {f. \<forall>n\<ge>m. f n = 0}) euclidean g
[PROOF STEP]
by (metis (lifting) continuous_map_into_fulltopology continuous_map_subtopology_eu order_refl topspace_Euclidean_space)
[PROOF STATE]
proof (state)
this:
continuous_map (top_of_set {f. \<forall>n\<ge>m. f n = 0}) euclidean g

goal (1 subgoal):
 1. continuous_on (topspace (Euclidean_space m)) g \<Longrightarrow> continuous_map (Euclidean_space m) euclidean g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_map (top_of_set {f. \<forall>n\<ge>m. f n = 0}) euclidean g
[PROOF STEP]
show "continuous_map (Euclidean_space m) euclidean g"
[PROOF STATE]
proof (prove)
using this:
continuous_map (top_of_set {f. \<forall>n\<ge>m. f n = 0}) euclidean g

goal (1 subgoal):
 1. continuous_map (Euclidean_space m) euclidean g
[PROOF STEP]
by (simp add: Euclidean_space_def euclidean_product_topology)
[PROOF STATE]
proof (state)
this:
continuous_map (Euclidean_space m) euclidean g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_mod_qr_poly:
assumes "degree (f::'a mod_ring poly) \<ge> n" "degree f < 2*n" "i<n"
shows "poly.coeff (f mod qr_poly) i = poly.coeff f i - poly.coeff f (i+n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff (f mod qr_poly) i = poly.coeff f i - poly.coeff f (i + n)
[PROOF STEP]
apply (subst mod_qr_poly[OF assms(1) assms(2)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff (take_deg n f - drop_deg n f) i = poly.coeff f i - poly.coeff f (i + n)
[PROOF STEP]
apply (subst coeff_diff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff (take_deg n f) i - poly.coeff (drop_deg n f) i = poly.coeff f i - poly.coeff f (i + n)
[PROOF STEP]
apply (unfold coeff_take_deg[OF assms(3)] coeff_drop_deg[OF assms(3)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff f i - poly.coeff f (i + n) = poly.coeff f i - poly.coeff f (i + n)
[PROOF STEP]
by auto


[STATEMENT]
lemma fls_divide_subdegree:
  fixes   f g :: "'a::division_ring fls"
  assumes "f \<noteq> 0" "g \<noteq> 0"
  shows   "fls_subdegree (f / g) = fls_subdegree f - fls_subdegree g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_subdegree (f / g) = fls_subdegree f - fls_subdegree g
[PROOF STEP]
proof (intro antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fls_subdegree (f / g) \<le> fls_subdegree f - fls_subdegree g
 2. fls_subdegree f - fls_subdegree g \<le> fls_subdegree (f / g)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f \<noteq> 0
g \<noteq> 0
[PROOF STEP]
have "f $$ fls_subdegree f / g $$ fls_subdegree g \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
f \<noteq> 0
g \<noteq> 0

goal (1 subgoal):
 1. f $$ fls_subdegree f / g $$ fls_subdegree g \<noteq> (0::'a)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
f $$ fls_subdegree f / g $$ fls_subdegree g \<noteq> (0::'a)

goal (2 subgoals):
 1. fls_subdegree (f / g) \<le> fls_subdegree f - fls_subdegree g
 2. fls_subdegree f - fls_subdegree g \<le> fls_subdegree (f / g)
[PROOF STEP]
thus "fls_subdegree (f/g) \<le> fls_subdegree f - fls_subdegree g"
[PROOF STATE]
proof (prove)
using this:
f $$ fls_subdegree f / g $$ fls_subdegree g \<noteq> (0::'a)

goal (1 subgoal):
 1. fls_subdegree (f / g) \<le> fls_subdegree f - fls_subdegree g
[PROOF STEP]
using fls_divide_nth_base[of f g]
[PROOF STATE]
proof (prove)
using this:
f $$ fls_subdegree f / g $$ fls_subdegree g \<noteq> (0::'a)
(f / g) $$ (fls_subdegree f - fls_subdegree g) = f $$ fls_subdegree f / g $$ fls_subdegree g

goal (1 subgoal):
 1. fls_subdegree (f / g) \<le> fls_subdegree f - fls_subdegree g
[PROOF STEP]
by (intro fls_subdegree_leI) simp
[PROOF STATE]
proof (state)
this:
fls_subdegree (f / g) \<le> fls_subdegree f - fls_subdegree g

goal (1 subgoal):
 1. fls_subdegree f - fls_subdegree g \<le> fls_subdegree (f / g)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f \<noteq> 0
g \<noteq> 0
[PROOF STEP]
have "f / g \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
f \<noteq> 0
g \<noteq> 0

goal (1 subgoal):
 1. f / g \<noteq> 0
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
f / g \<noteq> 0

goal (1 subgoal):
 1. fls_subdegree f - fls_subdegree g \<le> fls_subdegree (f / g)
[PROOF STEP]
thus "fls_subdegree (f/g) \<ge> fls_subdegree f - fls_subdegree g"
[PROOF STATE]
proof (prove)
using this:
f / g \<noteq> 0

goal (1 subgoal):
 1. fls_subdegree f - fls_subdegree g \<le> fls_subdegree (f / g)
[PROOF STEP]
using fls_divide_subdegree_ge
[PROOF STATE]
proof (prove)
using this:
f / g \<noteq> 0
?f / ?g \<noteq> 0 \<Longrightarrow> fls_subdegree ?f - fls_subdegree ?g \<le> fls_subdegree (?f / ?g)

goal (1 subgoal):
 1. fls_subdegree f - fls_subdegree g \<le> fls_subdegree (f / g)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
fls_subdegree f - fls_subdegree g \<le> fls_subdegree (f / g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Max_Un_absorb:
  assumes "finite X" "X \<noteq> {}" "finite Y" "(\<And>x y. y \<in> Y \<Longrightarrow> x \<in> X \<Longrightarrow> y \<le> x)"
  shows "Max (X \<union> Y) = Max X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max (X \<union> Y) = Max X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Max (X \<union> Y) = Max X
[PROOF STEP]
have Max_X_in_X: "Max X \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max X \<in> X
[PROOF STEP]
using Max_in[OF assms(1,2)]
[PROOF STATE]
proof (prove)
using this:
Max X \<in> X

goal (1 subgoal):
 1. Max X \<in> X
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Max X \<in> X

goal (1 subgoal):
 1. Max (X \<union> Y) = Max X
[PROOF STEP]
have Max_X_in_XY: "Max X \<in> X \<union> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max X \<in> X \<union> Y
[PROOF STEP]
using Max_in[OF assms(1,2)]
[PROOF STATE]
proof (prove)
using this:
Max X \<in> X

goal (1 subgoal):
 1. Max X \<in> X \<union> Y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Max X \<in> X \<union> Y

goal (1 subgoal):
 1. Max (X \<union> Y) = Max X
[PROOF STEP]
have fin: "finite (X \<union> Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (X \<union> Y)
[PROOF STEP]
using assms(1,3)
[PROOF STATE]
proof (prove)
using this:
finite X
finite Y

goal (1 subgoal):
 1. finite (X \<union> Y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (X \<union> Y)

goal (1 subgoal):
 1. Max (X \<union> Y) = Max X
[PROOF STEP]
have Y_le_Max_X: "\<And>y. y \<in> Y \<Longrightarrow> y \<le> Max X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y \<in> Y \<Longrightarrow> y \<le> Max X
[PROOF STEP]
using assms(4)[OF _ Max_X_in_X]
[PROOF STATE]
proof (prove)
using this:
?y \<in> Y \<Longrightarrow> ?y \<le> Max X

goal (1 subgoal):
 1. \<And>y. y \<in> Y \<Longrightarrow> y \<le> Max X
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
?y \<in> Y \<Longrightarrow> ?y \<le> Max X

goal (1 subgoal):
 1. Max (X \<union> Y) = Max X
[PROOF STEP]
have XY_le_Max_X: "\<And>y. y \<in> X \<union> Y \<Longrightarrow> y \<le> Max X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y \<in> X \<union> Y \<Longrightarrow> y \<le> Max X
[PROOF STEP]
using Max_ge[OF assms(1)] Y_le_Max_X
[PROOF STATE]
proof (prove)
using this:
?x \<in> X \<Longrightarrow> ?x \<le> Max X
?y \<in> Y \<Longrightarrow> ?y \<le> Max X

goal (1 subgoal):
 1. \<And>y. y \<in> X \<union> Y \<Longrightarrow> y \<le> Max X
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?y \<in> X \<union> Y \<Longrightarrow> ?y \<le> Max X

goal (1 subgoal):
 1. Max (X \<union> Y) = Max X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max (X \<union> Y) = Max X
[PROOF STEP]
using Max_eqI[OF fin XY_le_Max_X Max_X_in_XY]
[PROOF STATE]
proof (prove)
using this:
(\<And>y. y \<in> X \<union> Y \<Longrightarrow> y \<in> X \<union> Y) \<Longrightarrow> Max (X \<union> Y) = Max X

goal (1 subgoal):
 1. Max (X \<union> Y) = Max X
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Max (X \<union> Y) = Max X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powreal_less_antimono_base:
  assumes "r < 0" and "0 < a" and "a < b"
  shows "a pow\<^sub>\<real> r > b pow\<^sub>\<real> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b pow\<^sub>\<real> r < a pow\<^sub>\<real> r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b pow\<^sub>\<real> r < a pow\<^sub>\<real> r
[PROOF STEP]
have "0 < -r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < - r
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
r < 0

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

goal (1 subgoal):
 1. b pow\<^sub>\<real> r < a pow\<^sub>\<real> r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < - r
[PROOF STEP]
have "a pow\<^sub>\<real> - r < b pow\<^sub>\<real> - r"
[PROOF STATE]
proof (prove)
using this:
0 < - r

goal (1 subgoal):
 1. a pow\<^sub>\<real> - r < b pow\<^sub>\<real> - r
[PROOF STEP]
using assms(2) assms(3) powreal_less_mono_base
[PROOF STATE]
proof (prove)
using this:
0 < - r
0 < a
a < b
\<lbrakk>0 < ?r; 0 < ?a; ?a < ?b\<rbrakk> \<Longrightarrow> ?a pow\<^sub>\<real> ?r < ?b pow\<^sub>\<real> ?r

goal (1 subgoal):
 1. a pow\<^sub>\<real> - r < b pow\<^sub>\<real> - r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a pow\<^sub>\<real> - r < b pow\<^sub>\<real> - r

goal (1 subgoal):
 1. b pow\<^sub>\<real> r < a pow\<^sub>\<real> r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a pow\<^sub>\<real> - r < b pow\<^sub>\<real> - r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a pow\<^sub>\<real> - r < b pow\<^sub>\<real> - r

goal (1 subgoal):
 1. b pow\<^sub>\<real> r < a pow\<^sub>\<real> r
[PROOF STEP]
using assms(2) assms(3) powreal_gt_zero powreal_minus
[PROOF STATE]
proof (prove)
using this:
a pow\<^sub>\<real> - r < b pow\<^sub>\<real> - r
0 < a
a < b
0 < ?a \<Longrightarrow> 0 < ?a pow\<^sub>\<real> ?x
?a pow\<^sub>\<real> - ?x = inverse (?a pow\<^sub>\<real> ?x)

goal (1 subgoal):
 1. b pow\<^sub>\<real> r < a pow\<^sub>\<real> r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b pow\<^sub>\<real> r < a pow\<^sub>\<real> r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tanh_real_less_iff [simp]: "tanh x < tanh y \<longleftrightarrow> x < (y::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (tanh x < tanh y) = (x < y)
[PROOF STEP]
using tanh_real_strict_mono
[PROOF STATE]
proof (prove)
using this:
strict_mono tanh

goal (1 subgoal):
 1. (tanh x < tanh y) = (x < y)
[PROOF STEP]
by (simp add: strict_mono_less)


[STATEMENT]
lemma cong_eq_0_I: "(\<forall>i\<in>A. [f i mod n = 0] (mod n)) \<Longrightarrow> [\<Sum>i\<in>A. f i = 0] (mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>A. [f i mod n = 0::'b] (mod n) \<Longrightarrow> [sum f A = 0::'b] (mod n)
[PROOF STEP]
using cong_sum
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> ?A \<Longrightarrow> [?f x = ?g x] (mod ?a)) \<Longrightarrow> [sum ?f ?A = sum ?g ?A] (mod ?a)

goal (1 subgoal):
 1. \<forall>i\<in>A. [f i mod n = 0::'b] (mod n) \<Longrightarrow> [sum f A = 0::'b] (mod n)
[PROOF STEP]
by fastforce


[STATEMENT]
theorem length_brauns:
  "length (brauns k xs) = min (length xs) (2 ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (brauns k xs) = min (length xs) (2 ^ k)
[PROOF STEP]
proof (induct xs arbitrary: k rule: measure_induct_rule[where f=length])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x k. (\<And>y k. length y < length x \<Longrightarrow> length (brauns k y) = min (length y) (2 ^ k)) \<Longrightarrow> length (brauns k x) = min (length x) (2 ^ k)
[PROOF STEP]
case (less xs)
[PROOF STATE]
proof (state)
this:
length ?y < length xs \<Longrightarrow> length (brauns ?k ?y) = min (length ?y) (2 ^ ?k)

goal (1 subgoal):
 1. \<And>x k. (\<And>y k. length y < length x \<Longrightarrow> length (brauns k y) = min (length y) (2 ^ k)) \<Longrightarrow> length (brauns k x) = min (length x) (2 ^ k)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
length ?y < length xs \<Longrightarrow> length (brauns ?k ?y) = min (length ?y) (2 ^ ?k)

goal (1 subgoal):
 1. length (brauns k xs) = min (length xs) (2 ^ k)
[PROOF STEP]
by (simp add: brauns.simps[of k xs] length_nodes)
[PROOF STATE]
proof (state)
this:
length (brauns k xs) = min (length xs) (2 ^ k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma roots_of_real_rf_polys:
  "set (roots_of_real_rf_polys ps) = {x. \<exists> p \<in> set (polys_rf ps). poly (poly_rf p) x = 0 }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (roots_of_real_rf_polys ps) = {x. \<exists>p\<in>set (polys_rf ps). poly (poly_rf p) x = 0}
[PROOF STEP]
unfolding roots_of_real_rf_polys_def set_concat set_map image_comp o_def
    roots_of_real_rf_poly
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>set (polys_rf ps). {xa. poly (poly_rf x) xa = 0}) = {x. \<exists>p\<in>set (polys_rf ps). poly (poly_rf p) x = 0}
[PROOF STEP]
by auto


[STATEMENT]
lemma divisor_sigma_prime_power_field:
  fixes x :: "'a :: {field, nat_power}"
  assumes "prime p"
  shows   "divisor_sigma x (p ^ k) =
             (if nat_power p x = 1 then of_nat (k + 1) else
             (nat_power p x ^ Suc k - 1) / (nat_power p x - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
have "divisor_sigma x (p ^ k) = (\<Sum>i\<le>k. nat_power (p^i) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (\<Sum>i\<le>k. nat_power (p ^ i) x)
[PROOF STEP]
unfolding divisor_sigma_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd p ^ k. nat_power d x) = (\<Sum>i\<le>k. nat_power (p ^ i) x)
[PROOF STEP]
by (rule sum.reindex_bij_betw [symmetric])
       (insert assms, auto simp: bij_betw_def inj_on_def prime_gt_Suc_0_nat
          divides_primepow_nat intro: le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
divisor_sigma x (p ^ k) = (\<Sum>i\<le>k. nat_power (p ^ i) x)

goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
divisor_sigma x (p ^ k) = (\<Sum>i\<le>k. nat_power (p ^ i) x)

goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>k. nat_power p x ^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. nat_power (p ^ i) x) = sum ((^) (nat_power p x)) {..k}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. (\<Sum>i\<le>k. nat_power (p ^ i) x) = sum ((^) (nat_power p x)) {..k}
[PROOF STEP]
by (intro sum.cong refl) (simp_all add: prime_gt_0_nat nat_power_power_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. nat_power (p ^ i) x) = sum ((^) (nat_power p x)) {..k}

goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. nat_power (p ^ i) x) = sum ((^) (nat_power p x)) {..k}

goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
have "\<dots> = (if nat_power p x = 1 then of_nat (k + 1) else
                    (nat_power p x ^ Suc k - 1) / (nat_power p x - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) (nat_power p x)) {..k} = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
using geometric_sum[of "nat_power p x" "Suc k"]
[PROOF STATE]
proof (prove)
using this:
nat_power p x \<noteq> (1::'a) \<Longrightarrow> sum ((^) (nat_power p x)) {..<Suc k} = (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a))

goal (1 subgoal):
 1. sum ((^) (nat_power p x)) {..k} = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
unfolding lessThan_Suc_atMost
[PROOF STATE]
proof (prove)
using this:
nat_power p x \<noteq> (1::'a) \<Longrightarrow> sum ((^) (nat_power p x)) {..k} = (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a))

goal (1 subgoal):
 1. sum ((^) (nat_power p x)) {..k} = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
by (auto split: if_splits)
[PROOF STATE]
proof (state)
this:
sum ((^) (nat_power p x)) {..k} = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))

goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
divisor_sigma x (p ^ k) = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
divisor_sigma x (p ^ k) = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))

goal (1 subgoal):
 1. divisor_sigma x (p ^ k) = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
divisor_sigma x (p ^ k) = (if nat_power p x = (1::'a) then of_nat (k + 1) else (nat_power p x ^ Suc k - (1::'a)) / (nat_power p x - (1::'a)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fetch_jump_over2_o:
  "(fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 6) Oc)
 = (L, 2*n + 6)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 6) Oc = (L, 2 * n + 6)
[PROOF STEP]
apply(subgoal_tac "length (mopup_a n) = 4 * n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (mopup_a n) = 4 * n \<Longrightarrow> fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 6) Oc = (L, 2 * n + 6)
 2. length (mopup_a n) = 4 * n
[PROOF STEP]
apply(subgoal_tac "2*n + 6 = Suc (2*n + 5)", simp only: fetch.simps)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>length (mopup_a n) = 4 * n; 2 * n + 6 = Suc (2 * n + 5)\<rbrakk> \<Longrightarrow> (case nth_of (mopup_a n @ shift mopup_b (2 * n)) (2 * (2 * n + 5) + 1) of None \<Rightarrow> (Nop, 0) | Some i \<Rightarrow> i) = (L, Suc (2 * n + 5))
 2. length (mopup_a n) = 4 * n \<Longrightarrow> 2 * n + 6 = Suc (2 * n + 5)
 3. length (mopup_a n) = 4 * n
[PROOF STEP]
apply(auto simp: mopup_b_def nth_append shift.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma eigenvalue_char_matrix: assumes A: "(A :: 'a :: field mat) \<in> carrier_mat n n"
  shows "eigenvalue A e = (\<exists> v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> char_matrix A e *\<^sub>v v = 0\<^sub>v n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigenvalue A e = (\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> char_matrix A e *\<^sub>v v = 0\<^sub>v n)
[PROOF STEP]
unfolding eigenvalue_def eigenvector_char_matrix[OF A]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> char_matrix A e *\<^sub>v v = 0\<^sub>v n) = (\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> char_matrix A e *\<^sub>v v = 0\<^sub>v n)
[PROOF STEP]
..


[STATEMENT]
lemma tendsto_ln_powr_over_ln_powr':
  "c > 0 \<Longrightarrow> ((\<lambda>x::real. ln x powr d / ln (c*x) powr d) \<longlongrightarrow> 1) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c \<Longrightarrow> ((\<lambda>x. ln x powr d / ln (c * x) powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
using tendsto_ln_powr_over_ln_powr[of 1 c d]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 1; 0 < c\<rbrakk> \<Longrightarrow> ((\<lambda>x. ln (1 * x) powr d / ln (c * x) powr d) \<longlongrightarrow> 1) at_top

goal (1 subgoal):
 1. 0 < c \<Longrightarrow> ((\<lambda>x. ln x powr d / ln (c * x) powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
by simp


[STATEMENT]
lemma median_measurable:
  fixes X :: "nat \<Rightarrow> 'a \<Rightarrow> ('b :: {linorder_topology, second_countable_topology})"
  assumes "n \<ge> 1"
  assumes "\<And>i. i < n \<Longrightarrow> X i \<in> measurable M borel"
  shows "(\<lambda>x. median n (\<lambda>i. X i x)) \<in> measurable M borel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. median n (\<lambda>i. X i x)) \<in> borel_measurable M
[PROOF STEP]
apply (simp add:median_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. sort (map (\<lambda>i. X i x) [0..<n]) ! (n div 2)) \<in> borel_measurable M
[PROOF STEP]
apply (rule order_statistics_measurable[OF assms(1) _ assms(2)])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. n div 2 < n
 2. \<And>i. i < n \<Longrightarrow> i < n
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (2 subgoals):
 1. n div 2 < n
 2. \<And>i. i < n \<Longrightarrow> i < n
[PROOF STEP]
by force+


[STATEMENT]
lemma "(x::int)^3  - x^2  - 5*x - 3 = 0 \<longleftrightarrow> (x = 3 \<or> x = -1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x ^ 3 - x\<^sup>2 - 5 * x - 3 = 0) = (x = 3 \<or> x = - 1)
[PROOF STEP]
by algebra


[STATEMENT]
lemma nat_of_ipv4addr_ipv4addr_of_nat_mod: "nat_of_ipv4addr (ipv4addr_of_nat n) = n mod 2^32"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_of_ipv4addr (ipv4addr_of_nat n) = n mod 2 ^ 32
[PROOF STEP]
by (simp add: ipv4addr_of_nat_def nat_of_ipv4addr_def unat_of_nat take_bit_eq_mod)


[STATEMENT]
lemma dot_lmul_matrix: "inner ((x::real ^_) v* A) y = inner x (A *v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner (x v* A) y = inner x (A *v y)
[PROOF STEP]
apply (simp add: inner_vec_def matrix_vector_mult_def vector_matrix_mult_def sum_distrib_right sum_distrib_left ac_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. \<Sum>n\<in>UNIV. y $ i * (x $ n * A $ n $ i)) = (\<Sum>i\<in>UNIV. \<Sum>n\<in>UNIV. y $ n * (x $ i * A $ i $ n))
[PROOF STEP]
apply (subst sum.swap)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>UNIV. \<Sum>i\<in>UNIV. y $ i * (x $ j * A $ j $ i)) = (\<Sum>i\<in>UNIV. \<Sum>n\<in>UNIV. y $ n * (x $ i * A $ i $ n))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma deformation_retraction_imp_isomorphic_homology_groups:
   "\<lbrakk>retraction_maps X Y r s; homotopic_with (\<lambda>h. True) X X (s \<circ> r) id\<rbrakk>
        \<Longrightarrow> homology_group p X \<cong> homology_group p Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>retraction_maps X Y r s; homotopic_with (\<lambda>h. True) X X (s \<circ> r) id\<rbrakk> \<Longrightarrow> homology_group p X \<cong> homology_group p Y
[PROOF STEP]
by (simp add: deformation_retraction_imp_homotopy_equivalent_space homotopy_equivalent_space_imp_isomorphic_homology_groups)


[STATEMENT]
lemma mem_le_imp_MIN_le:
  fixes s :: "nat set" and k :: nat
  assumes "\<exists>x. (x \<in> s) \<and> (x \<le> k)"
  shows "(Inf s \<le> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf s \<le> k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf s \<le> k
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. x \<in> s \<and> x \<le> k
[PROOF STEP]
obtain x where 1: "x \<in> s" "x \<le> k"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. x \<in> s \<and> x \<le> k

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> s; x \<le> k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> s
x \<le> k

goal (1 subgoal):
 1. Inf s \<le> k
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
x \<in> s
x \<le> k

goal (1 subgoal):
 1. Inf s \<le> k
[PROOF STEP]
assume C: "Inf s > k"
[PROOF STATE]
proof (state)
this:
k < Inf s

goal (1 subgoal):
 1. Inf s \<le> k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k < Inf s
[PROOF STEP]
have "Inf s > x"
[PROOF STATE]
proof (prove)
using this:
k < Inf s

goal (1 subgoal):
 1. x < Inf s
[PROOF STEP]
using 1(2)
[PROOF STATE]
proof (prove)
using this:
k < Inf s
x \<le> k

goal (1 subgoal):
 1. x < Inf s
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x < Inf s

goal (1 subgoal):
 1. Inf s \<le> k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < Inf s
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
x < Inf s

goal (1 subgoal):
 1. False
[PROOF STEP]
using 1(1) cInf_lower leD
[PROOF STATE]
proof (prove)
using this:
x < Inf s
x \<in> s
\<lbrakk>?x \<in> ?X; bdd_below ?X\<rbrakk> \<Longrightarrow> Inf ?X \<le> ?x
?y \<le> ?x \<Longrightarrow> \<not> ?x < ?y

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

goal (1 subgoal):
 1. Inf s \<le> k
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
k < Inf s \<Longrightarrow> False

goal (1 subgoal):
 1. Inf s \<le> k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k < Inf s \<Longrightarrow> False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k < Inf s \<Longrightarrow> False

goal (1 subgoal):
 1. Inf s \<le> k
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
Inf s \<le> k

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>NOTE
  nat --> bool is the type of a HOL4 set and was translated to 'nat set'.\<close>
\<comment> \<open>NOTE
  We cannot use 'Min' instead of 'Inf' because there is no indication that '{n. s n}' will be
finite. Without that @{term "Min {n. s n} \<in> {n. s n}"} is not necessarily true.\<close>


[STATEMENT]
lemma binomial_plus_le:
  assumes "0 < k"
  shows "(m choose k) + (n choose k) \<le> (m + n) choose k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m choose k + (n choose k) \<le> m + n choose k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m choose k + (n choose k) \<le> m + n choose k
[PROOF STEP]
define k0 where "k0 = k - 1"
[PROOF STATE]
proof (state)
this:
k0 = k - 1

goal (1 subgoal):
 1. m choose k + (n choose k) \<le> m + n choose k
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < k
k0 = k - 1
[PROOF STEP]
have k: "k = Suc k0"
[PROOF STATE]
proof (prove)
using this:
0 < k
k0 = k - 1

goal (1 subgoal):
 1. k = Suc k0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k = Suc k0

goal (1 subgoal):
 1. m choose k + (n choose k) \<le> m + n choose k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m choose k + (n choose k) \<le> m + n choose k
[PROOF STEP]
unfolding k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m choose Suc k0 + (0 choose Suc k0) \<le> m + 0 choose Suc k0
 2. \<And>n. m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0 \<Longrightarrow> m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. m choose Suc k0 + (0 choose Suc k0) \<le> m + 0 choose Suc k0
 2. \<And>n. m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0 \<Longrightarrow> m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m choose Suc k0 + (0 choose Suc k0) \<le> m + 0 choose Suc k0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m choose Suc k0 + (0 choose Suc k0) \<le> m + 0 choose Suc k0

goal (1 subgoal):
 1. \<And>n. m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0 \<Longrightarrow> m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0 \<Longrightarrow> m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0

goal (1 subgoal):
 1. \<And>n. m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0 \<Longrightarrow> m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
have "m choose Suc k0 + (Suc n choose Suc k0) = m choose Suc k0 + (n choose Suc k0) + (n choose k0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m choose Suc k0 + (Suc n choose Suc k0) = m choose Suc k0 + (n choose Suc k0) + (n choose k0)
[PROOF STEP]
by (simp only: binomial_Suc_Suc)
[PROOF STATE]
proof (state)
this:
m choose Suc k0 + (Suc n choose Suc k0) = m choose Suc k0 + (n choose Suc k0) + (n choose k0)

goal (1 subgoal):
 1. \<And>n. m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0 \<Longrightarrow> m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
m choose Suc k0 + (Suc n choose Suc k0) = m choose Suc k0 + (n choose Suc k0) + (n choose k0)

goal (1 subgoal):
 1. \<And>n. m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0 \<Longrightarrow> m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0
[PROOF STEP]
have "\<dots> \<le> (m + n) choose Suc k0 + ((m + n) choose k0)"
[PROOF STATE]
proof (prove)
using this:
m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0

goal (1 subgoal):
 1. m choose Suc k0 + (n choose Suc k0) + (n choose k0) \<le> m + n choose Suc k0 + (m + n choose k0)
[PROOF STEP]
proof (rule add_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n choose k0 \<le> m + n choose k0
[PROOF STEP]
have "n \<le> m + n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> m + n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n \<le> m + n

goal (1 subgoal):
 1. n choose k0 \<le> m + n choose k0
[PROOF STEP]
thus "n choose k0 \<le> m + n choose k0"
[PROOF STATE]
proof (prove)
using this:
n \<le> m + n

goal (1 subgoal):
 1. n choose k0 \<le> m + n choose k0
[PROOF STEP]
by (rule binomial_mono)
[PROOF STATE]
proof (state)
this:
n choose k0 \<le> m + n choose k0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
m choose Suc k0 + (n choose Suc k0) + (n choose k0) \<le> m + n choose Suc k0 + (m + n choose k0)

goal (1 subgoal):
 1. \<And>n. m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0 \<Longrightarrow> m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
m choose Suc k0 + (n choose Suc k0) + (n choose k0) \<le> m + n choose Suc k0 + (m + n choose k0)

goal (1 subgoal):
 1. \<And>n. m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0 \<Longrightarrow> m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
have "\<dots> = m + Suc n choose Suc k0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m + n choose Suc k0 + (m + n choose k0) = m + Suc n choose Suc k0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m + n choose Suc k0 + (m + n choose k0) = m + Suc n choose Suc k0

goal (1 subgoal):
 1. \<And>n. m choose Suc k0 + (n choose Suc k0) \<le> m + n choose Suc k0 \<Longrightarrow> m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0

goal (1 subgoal):
 1. m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
m choose Suc k0 + (Suc n choose Suc k0) \<le> m + Suc n choose Suc k0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
m choose k + (n choose k) \<le> m + n choose k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cartesian_product_binary_union_left:
  assumes "C \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  assumes "D \<subseteq> carrier (R\<^bsup>n\<^esup>)"
  shows "cartesian_product (C \<union> D) A = (cartesian_product C A) \<union> (cartesian_product D A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product (C \<union> D) A = cartesian_product C A \<union> cartesian_product D A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. cartesian_product (C \<union> D) A \<subseteq> cartesian_product C A \<union> cartesian_product D A
 2. cartesian_product C A \<union> cartesian_product D A \<subseteq> cartesian_product (C \<union> D) A
[PROOF STEP]
show "cartesian_product (C \<union> D) A \<subseteq> cartesian_product C A \<union> cartesian_product D A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product (C \<union> D) A \<subseteq> cartesian_product C A \<union> cartesian_product D A
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. \<exists>as\<in>C \<union> D. \<exists>bs\<in>A. xs = as @ bs} \<subseteq> {xs. \<exists>as\<in>C. \<exists>bs\<in>A. xs = as @ bs} \<union> {xs. \<exists>as\<in>D. \<exists>bs\<in>A. xs = as @ bs}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cartesian_product (C \<union> D) A \<subseteq> cartesian_product C A \<union> cartesian_product D A

goal (1 subgoal):
 1. cartesian_product C A \<union> cartesian_product D A \<subseteq> cartesian_product (C \<union> D) A
[PROOF STEP]
show "cartesian_product C A \<union> cartesian_product D A \<subseteq> cartesian_product (C \<union> D) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product C A \<union> cartesian_product D A \<subseteq> cartesian_product (C \<union> D) A
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. \<exists>as\<in>C. \<exists>bs\<in>A. xs = as @ bs} \<union> {xs. \<exists>as\<in>D. \<exists>bs\<in>A. xs = as @ bs} \<subseteq> {xs. \<exists>as\<in>C \<union> D. \<exists>bs\<in>A. xs = as @ bs}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cartesian_product C A \<union> cartesian_product D A \<subseteq> cartesian_product (C \<union> D) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in module) lincomb_union:
  fixes a A B
  assumes h1: "finite (A\<union> B)"  and h3: "A\<union>B \<subseteq> carrier M"
    and h4: "A\<inter>B={}" and h5: "a\<in>(A\<union>B\<rightarrow>carrier R)"
  shows "lincomb a (A\<union>B) = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb a B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a (A \<union> B) = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb a B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (A \<union> B)
A \<union> B \<subseteq> carrier M
A \<inter> B = {}
a \<in> A \<union> B \<rightarrow> carrier R

goal (1 subgoal):
 1. lincomb a (A \<union> B) = lincomb a A \<oplus>\<^bsub>M\<^esub> lincomb a B
[PROOF STEP]
by (auto cong: finsum_cong2 simp add: lincomb_def finsum_Un_disjoint summands_valid ring_subset_carrier)


[STATEMENT]
lemma "2 ^ 10 = (1024::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ 10 = 1024
[PROOF STEP]
by simp


[STATEMENT]
lemma bitAND_1: "a && 1 = (a mod 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a && 1 = a mod 2
[PROOF STEP]
by (induction a; auto)


[STATEMENT]
lemma ln_nth_prime_asymptotics:
  "(\<lambda>n. ln (nth_prime n) - (ln n + ln (ln n))) \<in> o(\<lambda>_. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<in> o(\<lambda>_. 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<in> o(\<lambda>_. 1)
[PROOF STEP]
have "filterlim (\<lambda>n. ln (nth_prime n / (n * ln n))) (nhds (ln 1)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ln (real (nth_prime n) / (real n * ln (real n)))) \<longlonglongrightarrow> ln 1
[PROOF STEP]
by (intro tendsto_ln asymp_equivD_strong[OF nth_prime_asymptotics])
       (auto intro!: eventually_mono[OF eventually_gt_at_top[of 1]])
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ln (real (nth_prime n) / (real n * ln (real n)))) \<longlonglongrightarrow> ln 1

goal (1 subgoal):
 1. (\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<in> o(\<lambda>_. 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ln (real (nth_prime n) / (real n * ln (real n)))) \<longlonglongrightarrow> ln 1

goal (1 subgoal):
 1. (\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<in> o(\<lambda>_. 1)
[PROOF STEP]
have "?this \<longleftrightarrow> filterlim (\<lambda>n. ln (nth_prime n) - (ln n + ln (ln n))) (nhds 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ln (real (nth_prime n) / (real n * ln (real n)))) \<longlonglongrightarrow> ln 1 = (\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<longlonglongrightarrow> 0
[PROOF STEP]
using prime_gt_0_nat[OF prime_nth_prime]
[PROOF STATE]
proof (prove)
using this:
0 < nth_prime ?n1

goal (1 subgoal):
 1. (\<lambda>n. ln (real (nth_prime n) / (real n * ln (real n)))) \<longlonglongrightarrow> ln 1 = (\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<longlonglongrightarrow> 0
[PROOF STEP]
by (intro filterlim_cong refl eventually_mono[OF eventually_gt_at_top[of 1]])
       (auto simp: field_simps ln_mult ln_div)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ln (real (nth_prime n) / (real n * ln (real n)))) \<longlonglongrightarrow> ln 1 = (\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<in> o(\<lambda>_. 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<longlonglongrightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<in> o(\<lambda>_. 1)
[PROOF STEP]
by (intro smalloI_tendsto) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ln (real (nth_prime n)) - (ln (real n) + ln (ln (real n)))) \<in> o(\<lambda>_. 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma CARD_complement_domain:
  assumes \<open>CARD('b::finite) = n * CARD('a::finite)\<close>
  shows \<open>CARD(('a,'b) complement_domain) = n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD(('a, 'b) complement_domain) = n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. CARD(('a, 'b) complement_domain) = n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
CARD('b) = n * CARD('a)
[PROOF STEP]
have \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
CARD('b) = n * CARD('a)

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
by (metis zero_less_card_finite zero_less_mult_pos2)
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. CARD(('a, 'b) complement_domain) = n
[PROOF STEP]
have *: \<open>inj Rep_complement_domain\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj Rep_complement_domain
[PROOF STEP]
by (simp add: Rep_complement_domain_inject inj_on_def)
[PROOF STATE]
proof (state)
this:
inj Rep_complement_domain

goal (1 subgoal):
 1. CARD(('a, 'b) complement_domain) = n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj Rep_complement_domain

goal (1 subgoal):
 1. CARD(('a, 'b) complement_domain) = n
[PROOF STEP]
have \<open>card (range (Rep_complement_domain :: ('a,'b) complement_domain \<Rightarrow> _)) = n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (range Rep_complement_domain) = n
[PROOF STEP]
apply (subst type_definition.Rep_range[OF type_definition_complement_domain])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {..<if CARD('b) div CARD('a) \<noteq> 0 then CARD('b) div CARD('a) else 1} = n
[PROOF STEP]
using assms \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
CARD('b) = n * CARD('a)
0 < n

goal (1 subgoal):
 1. card {..<if CARD('b) div CARD('a) \<noteq> 0 then CARD('b) div CARD('a) else 1} = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (range Rep_complement_domain) = n

goal (1 subgoal):
 1. CARD(('a, 'b) complement_domain) = n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj Rep_complement_domain
card (range Rep_complement_domain) = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj Rep_complement_domain
card (range Rep_complement_domain) = n

goal (1 subgoal):
 1. CARD(('a, 'b) complement_domain) = n
[PROOF STEP]
by (metis card_image)
[PROOF STATE]
proof (state)
this:
CARD(('a, 'b) complement_domain) = n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma basis_enum_of_vec_mult:
  assumes [simp]: \<open>dim_vec v = length (canonical_basis :: 'a::basis_enum list)\<close>
  shows \<open>((basis_enum_of_vec (c \<cdot>\<^sub>v v)) :: 'a) =  c *\<^sub>C basis_enum_of_vec v\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_enum_of_vec (c \<cdot>\<^sub>v v) = c *\<^sub>C basis_enum_of_vec v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. basis_enum_of_vec (c \<cdot>\<^sub>v v) = c *\<^sub>C basis_enum_of_vec v
[PROOF STEP]
have *: \<open>monoid_add_hom ((*\<^sub>C) c :: 'a \<Rightarrow> _)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoid_add_hom ((*\<^sub>C) c)
[PROOF STEP]
by (simp add: monoid_add_hom_def plus_hom.intro scaleC_add_right semigroup_add_hom.intro zero_hom.intro)
[PROOF STATE]
proof (state)
this:
monoid_add_hom ((*\<^sub>C) c)

goal (1 subgoal):
 1. basis_enum_of_vec (c \<cdot>\<^sub>v v) = c *\<^sub>C basis_enum_of_vec v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_enum_of_vec (c \<cdot>\<^sub>v v) = c *\<^sub>C basis_enum_of_vec v
[PROOF STEP]
apply (auto simp: basis_enum_of_vec_def list_of_vec_mult map_zip_map
        monoid_add_hom.hom_sum_list[OF *])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map2 (\<lambda>x. (*\<^sub>C) (c * x)) (list_of_vec v) canonical_basis) = sum_list (map ((*\<^sub>C) c \<circ> (\<lambda>(x, y). x *\<^sub>C y)) (zip (list_of_vec v) canonical_basis))
[PROOF STEP]
by (metis case_prod_unfold comp_apply scaleC_scaleC)
[PROOF STATE]
proof (state)
this:
basis_enum_of_vec (c \<cdot>\<^sub>v v) = c *\<^sub>C basis_enum_of_vec v

goal:
No subgoals!
[PROOF STEP]
qed