[STATEMENT]
lemma bounded_bilinear_inner:
  "bounded_bilinear (inner::'a::real_inner \<Rightarrow> 'a \<Rightarrow> real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_bilinear inner
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>a a' b. inner (a + a') b = inner a b + inner a' b
 2. \<And>a b b'. inner a (b + b') = inner a b + inner a b'
 3. \<And>r a b. inner (r *\<^sub>R a) b = r *\<^sub>R inner a b
 4. \<And>a r b. inner a (r *\<^sub>R b) = r *\<^sub>R inner a b
 5. \<exists>K. \<forall>a b. norm (inner a b) \<le> norm a * norm b * K
[PROOF STEP]
fix x y z :: 'a and r :: real
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>a a' b. inner (a + a') b = inner a b + inner a' b
 2. \<And>a b b'. inner a (b + b') = inner a b + inner a b'
 3. \<And>r a b. inner (r *\<^sub>R a) b = r *\<^sub>R inner a b
 4. \<And>a r b. inner a (r *\<^sub>R b) = r *\<^sub>R inner a b
 5. \<exists>K. \<forall>a b. norm (inner a b) \<le> norm a * norm b * K
[PROOF STEP]
show "inner (x + y) z = inner x z + inner y z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner (x + y) z = inner x z + inner y z
[PROOF STEP]
by (rule inner_add_left)
[PROOF STATE]
proof (state)
this:
inner (x + y) z = inner x z + inner y z

goal (4 subgoals):
 1. \<And>a b b'. inner a (b + b') = inner a b + inner a b'
 2. \<And>r a b. inner (r *\<^sub>R a) b = r *\<^sub>R inner a b
 3. \<And>a r b. inner a (r *\<^sub>R b) = r *\<^sub>R inner a b
 4. \<exists>K. \<forall>a b. norm (inner a b) \<le> norm a * norm b * K
[PROOF STEP]
show "inner x (y + z) = inner x y + inner x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
by (rule inner_add_right)
[PROOF STATE]
proof (state)
this:
inner x (y + z) = inner x y + inner x z

goal (3 subgoals):
 1. \<And>r a b. inner (r *\<^sub>R a) b = r *\<^sub>R inner a b
 2. \<And>a r b. inner a (r *\<^sub>R b) = r *\<^sub>R inner a b
 3. \<exists>K. \<forall>a b. norm (inner a b) \<le> norm a * norm b * K
[PROOF STEP]
show "inner (scaleR r x) y = scaleR r (inner x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner (r *\<^sub>R x) y = r *\<^sub>R inner x y
[PROOF STEP]
unfolding real_scaleR_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner (r *\<^sub>R x) y = r * inner x y
[PROOF STEP]
by (rule inner_scaleR_left)
[PROOF STATE]
proof (state)
this:
inner (r *\<^sub>R x) y = r *\<^sub>R inner x y

goal (2 subgoals):
 1. \<And>a r b. inner a (r *\<^sub>R b) = r *\<^sub>R inner a b
 2. \<exists>K. \<forall>a b. norm (inner a b) \<le> norm a * norm b * K
[PROOF STEP]
show "inner x (scaleR r y) = scaleR r (inner x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x (r *\<^sub>R y) = r *\<^sub>R inner x y
[PROOF STEP]
unfolding real_scaleR_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x (r *\<^sub>R y) = r * inner x y
[PROOF STEP]
by (rule inner_scaleR_right)
[PROOF STATE]
proof (state)
this:
inner x (r *\<^sub>R y) = r *\<^sub>R inner x y

goal (1 subgoal):
 1. \<exists>K. \<forall>a b. norm (inner a b) \<le> norm a * norm b * K
[PROOF STEP]
show "\<exists>K. \<forall>x y::'a. norm (inner x y) \<le> norm x * norm y * K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>K. \<forall>x y. norm (inner x y) \<le> norm x * norm y * K
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x y. norm (inner x y) \<le> norm x * norm y * ?K
[PROOF STEP]
show "\<forall>x y::'a. norm (inner x y) \<le> norm x * norm y * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. norm (inner x y) \<le> norm x * norm y * 1
[PROOF STEP]
by (simp add: Cauchy_Schwarz_ineq2)
[PROOF STATE]
proof (state)
this:
\<forall>x y. norm (inner x y) \<le> norm x * norm y * 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>K. \<forall>x y. norm (inner x y) \<le> norm x * norm y * K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_two_impl1[elim]:
  assumes "a * 2 = 2 * b"
  shows "(a::enat) = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a * 2 = 2 * b

goal (1 subgoal):
 1. a = b
[PROOF STEP]
by(cases a;cases b,auto simp add: mult_2 mult_2_right)


[STATEMENT]
lemma from_digits_less:
  assumes "\<forall>i<n. d i < base"
  shows "from_digits n d < base ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. from_digits n d < base ^ n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i<n. d i < base

goal (1 subgoal):
 1. from_digits n d < base ^ n
[PROOF STEP]
proof (induct n d rule: from_digits.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>d. \<forall>i<0. d i < base \<Longrightarrow> from_digits 0 d < base ^ 0
 2. \<And>n d. \<lbrakk>\<forall>i<n. (d \<circ> Suc) i < base \<Longrightarrow> from_digits n (d \<circ> Suc) < base ^ n; \<forall>i<Suc n. d i < base\<rbrakk> \<Longrightarrow> from_digits (Suc n) d < base ^ Suc n
[PROOF STEP]
case (2 n d)
[PROOF STATE]
proof (state)
this:
\<forall>i<n. (d \<circ> Suc) i < base \<Longrightarrow> from_digits n (d \<circ> Suc) < base ^ n
\<forall>i<Suc n. d i < base

goal (2 subgoals):
 1. \<And>d. \<forall>i<0. d i < base \<Longrightarrow> from_digits 0 d < base ^ 0
 2. \<And>n d. \<lbrakk>\<forall>i<n. (d \<circ> Suc) i < base \<Longrightarrow> from_digits n (d \<circ> Suc) < base ^ n; \<forall>i<Suc n. d i < base\<rbrakk> \<Longrightarrow> from_digits (Suc n) d < base ^ Suc n
[PROOF STEP]
have "from_digits n (d \<circ> Suc) \<le> base ^ n -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. from_digits n (d \<circ> Suc) \<le> base ^ n - 1
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
\<forall>i<n. (d \<circ> Suc) i < base \<Longrightarrow> from_digits n (d \<circ> Suc) < base ^ n
\<forall>i<Suc n. d i < base

goal (1 subgoal):
 1. from_digits n (d \<circ> Suc) \<le> base ^ n - 1
[PROOF STEP]
by (metis One_nat_def Suc_leI Suc_pred base_pos comp_apply
        less_Suc_eq_le zero_less_power)
[PROOF STATE]
proof (state)
this:
from_digits n (d \<circ> Suc) \<le> base ^ n - 1

goal (2 subgoals):
 1. \<And>d. \<forall>i<0. d i < base \<Longrightarrow> from_digits 0 d < base ^ 0
 2. \<And>n d. \<lbrakk>\<forall>i<n. (d \<circ> Suc) i < base \<Longrightarrow> from_digits n (d \<circ> Suc) < base ^ n; \<forall>i<Suc n. d i < base\<rbrakk> \<Longrightarrow> from_digits (Suc n) d < base ^ Suc n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
from_digits n (d \<circ> Suc) \<le> base ^ n - 1

goal (2 subgoals):
 1. \<And>d. \<forall>i<0. d i < base \<Longrightarrow> from_digits 0 d < base ^ 0
 2. \<And>n d. \<lbrakk>\<forall>i<n. (d \<circ> Suc) i < base \<Longrightarrow> from_digits n (d \<circ> Suc) < base ^ n; \<forall>i<Suc n. d i < base\<rbrakk> \<Longrightarrow> from_digits (Suc n) d < base ^ Suc n
[PROOF STEP]
have "d 0 \<le> base -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d 0 \<le> base - 1
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
\<forall>i<n. (d \<circ> Suc) i < base \<Longrightarrow> from_digits n (d \<circ> Suc) < base ^ n
\<forall>i<Suc n. d i < base

goal (1 subgoal):
 1. d 0 \<le> base - 1
[PROOF STEP]
by (metis One_nat_def Suc_pred base_pos less_Suc_eq_0_disj
        less_Suc_eq_le)
[PROOF STATE]
proof (state)
this:
d 0 \<le> base - 1

goal (2 subgoals):
 1. \<And>d. \<forall>i<0. d i < base \<Longrightarrow> from_digits 0 d < base ^ 0
 2. \<And>n d. \<lbrakk>\<forall>i<n. (d \<circ> Suc) i < base \<Longrightarrow> from_digits n (d \<circ> Suc) < base ^ n; \<forall>i<Suc n. d i < base\<rbrakk> \<Longrightarrow> from_digits (Suc n) d < base ^ Suc n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
from_digits n (d \<circ> Suc) \<le> base ^ n - 1
d 0 \<le> base - 1
[PROOF STEP]
have "d 0 + base * from_digits n (d \<circ> Suc) \<le>
      base - 1 + base * (base^(n) - 1)"
[PROOF STATE]
proof (prove)
using this:
from_digits n (d \<circ> Suc) \<le> base ^ n - 1
d 0 \<le> base - 1

goal (1 subgoal):
 1. d 0 + base * from_digits n (d \<circ> Suc) \<le> base - 1 + base * (base ^ n - 1)
[PROOF STEP]
by (simp add: add_mono_thms_linordered_semiring(1))
[PROOF STATE]
proof (state)
this:
d 0 + base * from_digits n (d \<circ> Suc) \<le> base - 1 + base * (base ^ n - 1)

goal (2 subgoals):
 1. \<And>d. \<forall>i<0. d i < base \<Longrightarrow> from_digits 0 d < base ^ 0
 2. \<And>n d. \<lbrakk>\<forall>i<n. (d \<circ> Suc) i < base \<Longrightarrow> from_digits n (d \<circ> Suc) < base ^ n; \<forall>i<Suc n. d i < base\<rbrakk> \<Longrightarrow> from_digits (Suc n) d < base ^ Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d 0 + base * from_digits n (d \<circ> Suc) \<le> base - 1 + base * (base ^ n - 1)
[PROOF STEP]
show "from_digits (Suc n) d < base ^ Suc n"
[PROOF STATE]
proof (prove)
using this:
d 0 + base * from_digits n (d \<circ> Suc) \<le> base - 1 + base * (base ^ n - 1)

goal (1 subgoal):
 1. from_digits (Suc n) d < base ^ Suc n
[PROOF STEP]
using base_pos
[PROOF STATE]
proof (prove)
using this:
d 0 + base * from_digits n (d \<circ> Suc) \<le> base - 1 + base * (base ^ n - 1)
0 < base

goal (1 subgoal):
 1. from_digits (Suc n) d < base ^ Suc n
[PROOF STEP]
by (auto simp:comp_def)
    (metis Suc_pred add_gr_0 le_imp_less_Suc mult_Suc_right
      zero_less_power)
[PROOF STATE]
proof (state)
this:
from_digits (Suc n) d < base ^ Suc n

goal (1 subgoal):
 1. \<And>d. \<forall>i<0. d i < base \<Longrightarrow> from_digits 0 d < base ^ 0
[PROOF STEP]
qed auto


[STATEMENT]
lemma card_set_lbl: "card (set_lbl l) = length_lbl l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set_lbl l) = length_lbl l
[PROOF STEP]
unfolding set_lbl_def length_lbl_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (Rep_Label l)) = length (Rep_Label l)
[PROOF STEP]
using Rep_Label[of l, unfolded Label_def]
[PROOF STATE]
proof (prove)
using this:
Rep_Label l \<in> {xs. length xs \<le> Suc f \<and> distinct xs}

goal (1 subgoal):
 1. card (set (Rep_Label l)) = length (Rep_Label l)
[PROOF STEP]
by (auto elim: distinct_card)


[STATEMENT]
lemma set_eqI':
  assumes "\<And>x. x \<in> A \<Longrightarrow> x \<in> B"
  assumes "\<And>x. x \<in> B \<Longrightarrow> x \<in> A"
  shows "A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> ?x \<in> B
?x \<in> B \<Longrightarrow> ?x \<in> A

goal (1 subgoal):
 1. A = B
[PROOF STEP]
by auto


[STATEMENT]
lemma irreducible_dvd_pow:
  fixes p :: "'a poly"
  assumes irr: "irreducible p"
  shows "p dvd q ^ n \<Longrightarrow> p dvd q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p dvd q ^ n \<Longrightarrow> p dvd q
[PROOF STEP]
using field_poly_irreducible_imp_prime[OF irr]
[PROOF STATE]
proof (prove)
using this:
prime_elem p

goal (1 subgoal):
 1. p dvd q ^ n \<Longrightarrow> p dvd q
[PROOF STEP]
by (rule prime_elem_dvd_power)


[STATEMENT]
lemma card_set_mset:
  assumes "M \<subseteq># mset_set A"
  shows "card (set_mset M) = size M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set_mset M) = size M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
M \<subseteq># mset_set A

goal (1 subgoal):
 1. card (set_mset M) = size M
[PROOF STEP]
by (metis mset_set_set_mset size_mset_set)


[STATEMENT]
lemma transitive:
  fixes P :: pi
  and   Q :: pi
  and   R :: pi

  assumes "P \<simeq>\<^sup>s Q"
  and     "Q \<simeq>\<^sup>s R"

  shows "P \<simeq>\<^sup>s R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<simeq>\<^sup>s R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P \<simeq>\<^sup>s Q
Q \<simeq>\<^sup>s R

goal (1 subgoal):
 1. P \<simeq>\<^sup>s R
[PROOF STEP]
by(force simp add: congruenceSubst_def substClosed_def intro: Weak_Late_Cong.transitive)


[STATEMENT]
lemma div_Tr3_1:"\<lbrakk>(0::nat) < r; 0 < s; l mod s = s - 1\<rbrakk> \<Longrightarrow>  Suc l div s = Suc (l div s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l mod s = s - 1\<rbrakk> \<Longrightarrow> Suc l div s = Suc (l div s)
[PROOF STEP]
apply (frule rfn_tool12 [of "s" "l"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l mod s = s - 1; Suc (l div s) = Suc l div s\<rbrakk> \<Longrightarrow> Suc l div s = Suc (l div s)
[PROOF STEP]
apply (rotate_tac -1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Suc (l div s) = Suc l div s; 0 < r; 0 < s; l mod s = s - 1\<rbrakk> \<Longrightarrow> Suc l div s = Suc (l div s)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma has_derivative_componentwise_within:
   "(f has_derivative f') (at a within S) \<longleftrightarrow>
    (\<forall>i \<in> Basis. ((\<lambda>x. f x \<bullet> i) has_derivative (\<lambda>x. f' x \<bullet> i)) (at a within S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_derivative f') (at a within S) = (\<forall>i\<in>Basis. ((\<lambda>x. f x \<bullet> i) has_derivative (\<lambda>x. f' x \<bullet> i)) (at a within S))
[PROOF STEP]
apply (simp add: has_derivative_within)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bounded_linear f' \<and> ((\<lambda>y. (1 / norm (y - a)) *\<^sub>R (f y - (f a + f' (y - a)))) \<longlongrightarrow> (0::'b)) (at a within S)) = (\<forall>i\<in>Basis. bounded_linear (\<lambda>x. f' x \<bullet> i) \<and> ((\<lambda>y. (f y \<bullet> i - (f a \<bullet> i + f' (y - a) \<bullet> i)) / norm (y - a)) \<longlongrightarrow> 0) (at a within S))
[PROOF STEP]
apply (subst tendsto_componentwise_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bounded_linear f' \<and> (\<forall>i\<in>Basis. ((\<lambda>x. (1 / norm (x - a)) *\<^sub>R (f x - (f a + f' (x - a))) \<bullet> i) \<longlongrightarrow> (0::'b) \<bullet> i) (at a within S))) = (\<forall>i\<in>Basis. bounded_linear (\<lambda>x. f' x \<bullet> i) \<and> ((\<lambda>y. (f y \<bullet> i - (f a \<bullet> i + f' (y - a) \<bullet> i)) / norm (y - a)) \<longlongrightarrow> 0) (at a within S))
[PROOF STEP]
apply (simp add: bounded_linear_componentwise_iff [symmetric] ball_conj_distrib)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bounded_linear f' \<and> (\<forall>i\<in>Basis. ((\<lambda>x. (f x - (f a + f' (x - a))) \<bullet> i / norm (x - a)) \<longlongrightarrow> 0) (at a within S))) = (bounded_linear f' \<and> (\<forall>i\<in>Basis. ((\<lambda>y. (f y \<bullet> i - (f a \<bullet> i + f' (y - a) \<bullet> i)) / norm (y - a)) \<longlongrightarrow> 0) (at a within S)))
[PROOF STEP]
apply (simp add: algebra_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fps_of_poly_pCons:
  "fps_of_poly (pCons (c :: 'a :: semiring_1) p) = fps_const c + fps_of_poly p * fps_X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (pCons c p) = fps_const c + fps_of_poly p * fps_X
[PROOF STEP]
by (subst fps_mult_fps_X_commute [symmetric], intro fps_ext)
     (auto simp: fps_of_poly_def coeff_pCons split: nat.split)


[STATEMENT]
lemma norm_mult_vec:
  fixes a::"(real,'b::finite) vec"
  shows "norm (x \<bullet> x) = norm x * norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x \<bullet> x) = norm x * norm x
[PROOF STEP]
by (metis inner_real_def norm_cauchy_schwarz_eq norm_mult)


[STATEMENT]
lemma hermitean_eye' [simp]:
  shows "hermitean (1, 0, 0, 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitean (1, 0, 0, 1)
[PROOF STEP]
by (auto simp add:  hermitean_def mat_adj_def mat_cnj_def)


[STATEMENT]
lemma back_edge_impl_tree_path:
    "\<lbrakk>(v,w) \<in> back_edges s; v \<noteq> w\<rbrakk> \<Longrightarrow> (w,v) \<in> (tree_edges s)\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(v, w) \<in> back_edges s; v \<noteq> w\<rbrakk> \<Longrightarrow> (w, v) \<in> (tree_edges s)\<^sup>+
[PROOF STEP]
using i_back_edge_impl_tree_path[THEN make_invar_thm]
[PROOF STATE]
proof (prove)
using this:
\<forall>(v, w)\<in>back_edges s. (w, v) \<in> (tree_edges s)\<^sup>+ \<or> w = v

goal (1 subgoal):
 1. \<lbrakk>(v, w) \<in> back_edges s; v \<noteq> w\<rbrakk> \<Longrightarrow> (w, v) \<in> (tree_edges s)\<^sup>+
[PROOF STEP]
by blast


[STATEMENT]
lemma "(x::nat) - 5 > y ==> y < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x - 5 \<Longrightarrow> y < x
[PROOF STEP]
by linarith


[STATEMENT]
lemma "(\<lambda>n. log 2 (real ((n + 3) choose 3) / 4) + 1) \<sim> (\<lambda>n. 3 / ln 2 * ln n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) \<sim>[sequentially] (\<lambda>x. 3 / ln 2 * ln (real x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) \<sim>[sequentially] (\<lambda>x. 3 / ln 2 * ln (real x))
[PROOF STEP]
have "(\<lambda>n. log 2 (real ((n + 3) choose 3) / 4) + 1) =
          (\<lambda>n. log 2 ((real n + 1) * (real n + 2) * (real n + 3) / 24) + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) = (\<lambda>n. log 2 ((real n + 1) * (real n + 2) * (real n + 3) / 24) + 1)
[PROOF STEP]
by (subst binomial_gbinomial)
       (simp add: gbinomial_pochhammer' numeral_3_eq_3 pochhammer_Suc add_ac)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) = (\<lambda>n. log 2 ((real n + 1) * (real n + 2) * (real n + 3) / 24) + 1)

goal (1 subgoal):
 1. (\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) \<sim>[sequentially] (\<lambda>x. 3 / ln 2 * ln (real x))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) = (\<lambda>n. log 2 ((real n + 1) * (real n + 2) * (real n + 3) / 24) + 1)

goal (1 subgoal):
 1. (\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) \<sim>[sequentially] (\<lambda>x. 3 / ln 2 * ln (real x))
[PROOF STEP]
have "\<dots> \<sim> (\<lambda>n. 3 / ln 2 * ln n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. log 2 ((real n + 1) * (real n + 2) * (real n + 3) / 24) + 1) \<sim>[sequentially] (\<lambda>x. 3 / ln 2 * ln (real x))
[PROOF STEP]
by (real_asymp simp: field_split_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. log 2 ((real n + 1) * (real n + 2) * (real n + 3) / 24) + 1) \<sim>[sequentially] (\<lambda>x. 3 / ln 2 * ln (real x))

goal (1 subgoal):
 1. (\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) \<sim>[sequentially] (\<lambda>x. 3 / ln 2 * ln (real x))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) = (\<lambda>n. log 2 ((real n + 1) * (real n + 2) * (real n + 3) / 24) + 1)
(\<lambda>n. log 2 ((real n + 1) * (real n + 2) * (real n + 3) / 24) + 1) \<sim>[sequentially] (\<lambda>x. 3 / ln 2 * ln (real x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) = (\<lambda>n. log 2 ((real n + 1) * (real n + 2) * (real n + 3) / 24) + 1)
(\<lambda>n. log 2 ((real n + 1) * (real n + 2) * (real n + 3) / 24) + 1) \<sim>[sequentially] (\<lambda>x. 3 / ln 2 * ln (real x))

goal (1 subgoal):
 1. (\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) \<sim>[sequentially] (\<lambda>x. 3 / ln 2 * ln (real x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. log 2 (real (n + 3 choose 3) / 4) + 1) \<sim>[sequentially] (\<lambda>x. 3 / ln 2 * ln (real x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma four_x_squared: "4 * x\<^sup>2 = (2 * x)\<^sup>2"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * x\<^sup>2 = (2 * x)\<^sup>2
[PROOF STEP]
by (simp add: power2_eq_square)


[STATEMENT]
lemma (in euclidean_space) euclidean_inner: "inner x y = (\<Sum>b\<in>Basis. (inner x b) * (inner y b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x y = (\<Sum>b\<in>Basis. inner x b * inner y b)
[PROOF STEP]
by (subst (1 2) euclidean_representation [symmetric])
    (simp add: inner_sum_right inner_Basis ac_simps)


[STATEMENT]
lemma (in prob_space) exponential_distributed_sum:
  assumes finI: "finite I"
  assumes A: "I \<noteq> {}"
  assumes l: "0 < l"
  assumes expX: "\<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (exponential_density l)"
  assumes ind: "indep_vars (\<lambda>i. borel) X I"
  shows "distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (erlang_density ((card I) - 1) l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (\<lambda>x. ennreal (erlang_density (card I - 1) l x))
[PROOF STEP]
using erlang_distributed_sum[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i \<in> I \<Longrightarrow> i \<in> I) \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>I. Suc 0) - 1) l x))

goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (\<lambda>x. ennreal (erlang_density (card I - 1) l x))
[PROOF STEP]
by simp


[STATEMENT]
lemma not_is_zero_iarray_eq_iff: "(\<exists>b. A $ b \<noteq> 0) = (\<not> is_zero_iarray (vec_to_iarray A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>b. A $ b \<noteq> (0::'b)) = (\<not> is_zero_iarray (vec_to_iarray A))
[PROOF STEP]
by (metis (full_types) is_zero_iarray_eq_iff vec_eq_iff zero_index)


[STATEMENT]
theorem finite_fsets: "finite (F::('a::finite)set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite F
[PROOF STEP]
from finite_subset[OF subset_UNIV]
[PROOF STATE]
proof (chain)
picking this:
finite UNIV \<Longrightarrow> finite ?A
[PROOF STEP]
show "finite F"
[PROOF STATE]
proof (prove)
using this:
finite UNIV \<Longrightarrow> finite ?A

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma floor_less_one [simp]: "\<lfloor>x\<rfloor> < 1 \<longleftrightarrow> x < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> < 1) = (x < (1::'a))
[PROOF STEP]
by (simp add: floor_less_iff)


[STATEMENT]
lemma sum_pow2_image_Suc:
  "finite X \<Longrightarrow> sum ((^) (2 :: nat)) (Suc ` X) = 2 * sum ((^) 2) X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite X \<Longrightarrow> sum ((^) 2) (Suc ` X) = 2 * sum ((^) 2) X
[PROOF STEP]
by (induct X rule: finite_induct) (auto intro: trans[OF sum.insert])


[STATEMENT]
lemma choose_row_sum: "(\<Sum>k\<le>n. n choose k) = 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((choose) n) {..n} = 2 ^ n
[PROOF STEP]
using binomial [of 1 "1" n]
[PROOF STATE]
proof (prove)
using this:
(1 + 1) ^ n = (\<Sum>k\<le>n. of_nat (n choose k) * 1 ^ k * 1 ^ (n - k))

goal (1 subgoal):
 1. sum ((choose) n) {..n} = 2 ^ n
[PROOF STEP]
by (simp add: numeral_2_eq_2)


[STATEMENT]
lemma content_pos_lt_eq: "0 < content (cbox a (b::'a::euclidean_space)) \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i < b\<bullet>i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < content (cbox a b)) = (\<forall>i\<in>Basis. a \<bullet> i < b \<bullet> i)
[PROOF STEP]
by (auto simp add: content_cbox_cases less_le prod_nonneg)


[STATEMENT]
lemma cmod_eq_one [simp]:
  shows "cmod a = 1 \<longleftrightarrow> a*cnj a = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod a = 1) = (a * cnj a = 1)
[PROOF STEP]
by (metis cmod_eqE cmod_eqI complex_cnj_one monoid_mult_class.mult.left_neutral norm_one)


[STATEMENT]
lemma cinner_canonical_basis_eq':
  defines "basisA == set (canonical_basis::'a::onb_enum list)"
    and   "basisB == set (canonical_basis::'b::onb_enum list)"
  assumes "\<And>u v. u\<in>basisA \<Longrightarrow> v\<in>basisB \<Longrightarrow> (F *\<^sub>V u) \<bullet>\<^sub>C v = (G *\<^sub>V u) \<bullet>\<^sub>C v"
  shows "F = G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F = G
[PROOF STEP]
using cinner_canonical_basis_eq assms
[PROOF STATE]
proof (prove)
using this:
(\<And>u v. \<lbrakk>u \<in> set canonical_basis; v \<in> set canonical_basis\<rbrakk> \<Longrightarrow> v \<bullet>\<^sub>C (?F *\<^sub>V u) = v \<bullet>\<^sub>C (?G *\<^sub>V u)) \<Longrightarrow> ?F = ?G
basisA \<equiv> set canonical_basis
basisB \<equiv> set canonical_basis
\<lbrakk>?u \<in> basisA; ?v \<in> basisB\<rbrakk> \<Longrightarrow> (F *\<^sub>V ?u) \<bullet>\<^sub>C ?v = (G *\<^sub>V ?u) \<bullet>\<^sub>C ?v

goal (1 subgoal):
 1. F = G
[PROOF STEP]
by (metis cinner_commute')


[STATEMENT]
lemma of_nat_minus_hmset: "of_nat (m - n) = (of_nat m :: hmultiset) - of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (m - n) = of_nat m - of_nat n
[PROOF STEP]
unfolding of_nat_hmset minus_hmultiset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HMSet (replicate_mset (m - n) 0) = HMSet (hmsetmset (HMSet (replicate_mset m 0)) - hmsetmset (HMSet (replicate_mset n 0)))
[PROOF STEP]
by simp


[STATEMENT]
lemma lemma_6_1_2_b:
  assumes "v \<le> u"
  shows "(\<Sum>t. l^t *\<^sub>R \<P>\<^sub>1 ^^t) v \<le> (\<Sum>t. l^t *\<^sub>R \<P>\<^sub>1 ^^t) u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blinfun_apply (\<Sum>t. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) v \<le> blinfun_apply (\<Sum>t. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) u
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. blinfun_apply (\<Sum>t. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) v \<le> blinfun_apply (\<Sum>t. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) u
[PROOF STEP]
have "0 \<le> (\<Sum>n. l ^ n *\<^sub>R \<P>\<^sub>1 ^^ n) (u - v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> blinfun_apply (\<Sum>n. l ^ n *\<^sub>R \<P>\<^sub>1 ^^ n) (u - v)
[PROOF STEP]
using \<P>\<^sub>1_suminf_pos assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?u \<Longrightarrow> 0 \<le> blinfun_apply (\<Sum>t. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) ?u
v \<le> u

goal (1 subgoal):
 1. 0 \<le> blinfun_apply (\<Sum>n. l ^ n *\<^sub>R \<P>\<^sub>1 ^^ n) (u - v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> blinfun_apply (\<Sum>n. l ^ n *\<^sub>R \<P>\<^sub>1 ^^ n) (u - v)

goal (1 subgoal):
 1. blinfun_apply (\<Sum>t. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) v \<le> blinfun_apply (\<Sum>t. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) u
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> blinfun_apply (\<Sum>n. l ^ n *\<^sub>R \<P>\<^sub>1 ^^ n) (u - v)

goal (1 subgoal):
 1. blinfun_apply (\<Sum>t. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) v \<le> blinfun_apply (\<Sum>t. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) u
[PROOF STEP]
by (simp add: blinfun.diff_right)
[PROOF STATE]
proof (state)
this:
blinfun_apply (\<Sum>t. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) v \<le> blinfun_apply (\<Sum>t. l ^ t *\<^sub>R \<P>\<^sub>1 ^^ t) u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma yun_rel_mult: "yun_rel F c f \<Longrightarrow> yun_rel G d g \<Longrightarrow> yun_rel (F * G) (c * d) (f * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>yun_rel F c f; yun_rel G d g\<rbrakk> \<Longrightarrow> yun_rel (F * G) (c * d) (f * g)
[PROOF STEP]
unfolding yun_rel_def yun_wrel_def content_mult lead_coeff_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>of_int_poly F = Polynomial.smult c f \<and> content F = 1 \<and> 0 < lead_coeff F \<and> monic f; of_int_poly G = Polynomial.smult d g \<and> content G = 1 \<and> 0 < lead_coeff G \<and> monic g\<rbrakk> \<Longrightarrow> of_int_poly (F * G) = Polynomial.smult (c * d) (f * g) \<and> content F * content G = 1 \<and> 0 < lead_coeff F * lead_coeff G \<and> lead_coeff f * lead_coeff g = 1
[PROOF STEP]
by (auto simp: monic_mult hom_distribs)


[STATEMENT]
lemma diff_frac_eq:
  assumes "x \<in> carrier R" "y \<in> carrier R" "z \<in> carrier R" "w \<in> carrier R"
    and "y \<noteq> \<zero>" "z \<noteq> \<zero>"
  shows "x \<oslash> y \<ominus> w \<oslash> z = (x \<otimes> z \<ominus> w \<otimes> y) \<oslash> (y \<otimes> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<oslash> y \<ominus> w \<oslash> z = (x \<otimes> z \<ominus> w \<otimes> y) \<oslash> (y \<otimes> z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
y \<in> carrier R
z \<in> carrier R
w \<in> carrier R
y \<noteq> \<zero>
z \<noteq> \<zero>

goal (1 subgoal):
 1. x \<oslash> y \<ominus> w \<oslash> z = (x \<otimes> z \<ominus> w \<otimes> y) \<oslash> (y \<otimes> z)
[PROOF STEP]
by (simp add: minus_eq l_minus add_frac_eq)


[STATEMENT]
lemma sqrt_int_ceiling[simp]: "sqrt_int_ceiling x = \<lceil> sqrt (of_int x) \<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt_int_ceiling x = \<lceil>sqrt (real_of_int x)\<rceil>
[PROOF STEP]
by (simp add: sqrt_int_ceiling_def sqrt_def)


[STATEMENT]
lemma mahler_measure_monic_ge_1: "mahler_measure_monic p \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> mahler_measure_monic p
[PROOF STEP]
unfolding mahler_measure_monic_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> (\<Prod>a\<leftarrow>complex_roots_complex p. max 1 (cmod a))
[PROOF STEP]
by(rule prod_list_ge1,simp)


[STATEMENT]
lemma lm146:
  assumes "card (Pow A) \<noteq> 0"
  shows "card A=Discrete.log (card (Pow A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A = Discrete.log (card (Pow A))
[PROOF STEP]
using assms log_exp card_Pow
[PROOF STATE]
proof (prove)
using this:
card (Pow A) \<noteq> 0
Discrete.log (2 ^ ?n) = ?n
finite ?A \<Longrightarrow> card (Pow ?A) = 2 ^ card ?A

goal (1 subgoal):
 1. card A = Discrete.log (card (Pow A))
[PROOF STEP]
by (metis card.infinite finite_Pow_iff)


[STATEMENT]
theorem inorder_insert:
  "sorted(inorder t) \<Longrightarrow> inorder(insert x t) = ins_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorted_Less.sorted (Tree2.inorder t) \<Longrightarrow> Tree2.inorder (local.insert x t) = ins_list x (Tree2.inorder t)
[PROOF STEP]
by (induct t)
   (auto simp: ins_list_simps inorder_balL inorder_balR)