[STATEMENT]
lemma LIMSEQ_Suc_n_over_n: "(\<lambda>n. of_nat (Suc n) / of_nat n :: 'a :: real_normed_field) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. of_nat (Suc n) / of_nat n) \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
proof (rule Lim_transform_eventually)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?f \<longlonglongrightarrow> (1::'a)
 2. \<forall>\<^sub>F x in sequentially. ?f x = of_nat (Suc x) / of_nat x
[PROOF STEP]
show "eventually (\<lambda>n. 1 + inverse (of_nat n :: 'a) = of_nat (Suc n) / of_nat n) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (1::'a) + inverse (of_nat n) = of_nat (Suc n) / of_nat n
[PROOF STEP]
using eventually_gt_at_top[of "0::nat"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (1::'a) + inverse (of_nat n) = of_nat (Suc n) / of_nat n
[PROOF STEP]
by eventually_elim (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (1::'a) + inverse (of_nat n) = of_nat (Suc n) / of_nat n

goal (1 subgoal):
 1. (\<lambda>n. (1::'a) + inverse (of_nat n)) \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
have "(\<lambda>n. 1 + inverse (of_nat n) :: 'a) \<longlonglongrightarrow> 1 + 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (1::'a) + inverse (of_nat n)) \<longlonglongrightarrow> (1::'a) + (0::'a)
[PROOF STEP]
by (intro tendsto_add tendsto_const lim_inverse_n)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (1::'a) + inverse (of_nat n)) \<longlonglongrightarrow> (1::'a) + (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. (1::'a) + inverse (of_nat n)) \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (1::'a) + inverse (of_nat n)) \<longlonglongrightarrow> (1::'a) + (0::'a)
[PROOF STEP]
show "(\<lambda>n. 1 + inverse (of_nat n) :: 'a) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (1::'a) + inverse (of_nat n)) \<longlonglongrightarrow> (1::'a) + (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. (1::'a) + inverse (of_nat n)) \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (1::'a) + inverse (of_nat n)) \<longlonglongrightarrow> (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_diff_one [simp]: "\<lceil>x - 1\<rceil> = \<lceil>x\<rceil> - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>x - (1::'a)\<rceil> = \<lceil>x\<rceil> - 1
[PROOF STEP]
using ceiling_diff_of_int [of x 1]
[PROOF STATE]
proof (prove)
using this:
\<lceil>x - of_int 1\<rceil> = \<lceil>x\<rceil> - 1

goal (1 subgoal):
 1. \<lceil>x - (1::'a)\<rceil> = \<lceil>x\<rceil> - 1
[PROOF STEP]
by simp


[STATEMENT]
lemma fib_add: "fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n"
  (is "?P n")
  \<comment> \<open>see @{cite \<open>page 280\<close> "Concrete-Math"}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n
[PROOF STEP]
proof (induct n rule: fib_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. fib (0 + k + 1) = fib (k + 1) * fib (0 + 1) + fib k * fib 0
 2. fib (1 + k + 1) = fib (k + 1) * fib (1 + 1) + fib k * fib 1
 3. \<And>n. \<lbrakk>fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1); fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n\<rbrakk> \<Longrightarrow> fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
show "?P 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fib (0 + k + 1) = fib (k + 1) * fib (0 + 1) + fib k * fib 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fib (0 + k + 1) = fib (k + 1) * fib (0 + 1) + fib k * fib 0

goal (2 subgoals):
 1. fib (1 + k + 1) = fib (k + 1) * fib (1 + 1) + fib k * fib 1
 2. \<And>n. \<lbrakk>fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1); fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n\<rbrakk> \<Longrightarrow> fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
show "?P 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fib (1 + k + 1) = fib (k + 1) * fib (1 + 1) + fib k * fib 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fib (1 + k + 1) = fib (k + 1) * fib (1 + 1) + fib k * fib 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1); fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n\<rbrakk> \<Longrightarrow> fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1); fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n\<rbrakk> \<Longrightarrow> fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
have "fib (n + 2 + k + 1)
    = fib (n + k + 1) + fib (n + 1 + k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fib (n + 2 + k + 1) = fib (n + k + 1) + fib (n + 1 + k + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fib (n + 2 + k + 1) = fib (n + k + 1) + fib (n + 1 + k + 1)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1); fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n\<rbrakk> \<Longrightarrow> fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fib (n + 2 + k + 1) = fib (n + k + 1) + fib (n + 1 + k + 1)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1); fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n\<rbrakk> \<Longrightarrow> fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
assume "fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n" (is " _ = ?R1")
[PROOF STATE]
proof (state)
this:
fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1); fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n\<rbrakk> \<Longrightarrow> fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1); fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n\<rbrakk> \<Longrightarrow> fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
assume "fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1)"
    (is " _ = ?R2")
[PROOF STATE]
proof (state)
this:
fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1); fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n\<rbrakk> \<Longrightarrow> fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1); fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n\<rbrakk> \<Longrightarrow> fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
have "?R1 + ?R2 = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fib (k + 1) * fib (n + 1) + fib k * fib n + (fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1)) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
by (simp add: add_mult_distrib2)
[PROOF STATE]
proof (state)
this:
fib (k + 1) * fib (n + 1) + fib k * fib n + (fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1)) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>fib (n + 1 + k + 1) = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1); fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n\<rbrakk> \<Longrightarrow> fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
show "?P (n + 2)"
[PROOF STATE]
proof (prove)
using this:
fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)

goal (1 subgoal):
 1. fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fib (n + 2 + k + 1) = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lim_mono:
  fixes X Y :: "nat \<Rightarrow> 'a::linorder_topology"
  assumes "\<And>n. N \<le> n \<Longrightarrow> X n \<le> Y n"
    and "X \<longlonglongrightarrow> x"
    and "Y \<longlonglongrightarrow> y"
  shows "x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n \<Longrightarrow> X ?n \<le> Y ?n

goal (1 subgoal):
 1. x \<le> y
[PROOF STEP]
by (intro LIMSEQ_le[OF assms(2,3)]) auto


[STATEMENT]
lemma gbinomial_sum_up_index:
  "(\<Sum>j = 0..n. (of_nat j gchoose k) :: 'a::field_char_0) = (of_nat n + 1) gchoose (k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..n. of_nat j gchoose k) = of_nat n + (1::'a) gchoose (k + 1)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Sum>j = 0..0. of_nat j gchoose k) = of_nat 0 + (1::'a) gchoose (k + 1)
 2. \<And>n. (\<Sum>j = 0..n. of_nat j gchoose k) = of_nat n + (1::'a) gchoose (k + 1) \<Longrightarrow> (\<Sum>j = 0..Suc n. of_nat j gchoose k) = of_nat (Suc n) + (1::'a) gchoose (k + 1)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<Sum>j = 0..0. of_nat j gchoose k) = of_nat 0 + (1::'a) gchoose (k + 1)
 2. \<And>n. (\<Sum>j = 0..n. of_nat j gchoose k) = of_nat n + (1::'a) gchoose (k + 1) \<Longrightarrow> (\<Sum>j = 0..Suc n. of_nat j gchoose k) = of_nat (Suc n) + (1::'a) gchoose (k + 1)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..0. of_nat j gchoose k) = of_nat 0 + (1::'a) gchoose (k + 1)
[PROOF STEP]
using gbinomial_Suc_Suc[of 0 k]
[PROOF STATE]
proof (prove)
using this:
(0::?'b1) + (1::?'b1) gchoose Suc k = (0::?'b1) gchoose k + ((0::?'b1) gchoose Suc k)

goal (1 subgoal):
 1. (\<Sum>j = 0..0. of_nat j gchoose k) = of_nat 0 + (1::'a) gchoose (k + 1)
[PROOF STEP]
by (cases k) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..0. of_nat j gchoose k) = of_nat 0 + (1::'a) gchoose (k + 1)

goal (1 subgoal):
 1. \<And>n. (\<Sum>j = 0..n. of_nat j gchoose k) = of_nat n + (1::'a) gchoose (k + 1) \<Longrightarrow> (\<Sum>j = 0..Suc n. of_nat j gchoose k) = of_nat (Suc n) + (1::'a) gchoose (k + 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<Sum>j = 0..n. of_nat j gchoose k) = of_nat n + (1::'a) gchoose (k + 1) \<Longrightarrow> (\<Sum>j = 0..Suc n. of_nat j gchoose k) = of_nat (Suc n) + (1::'a) gchoose (k + 1)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..n. of_nat j gchoose k) = of_nat n + (1::'a) gchoose (k + 1)

goal (1 subgoal):
 1. \<And>n. (\<Sum>j = 0..n. of_nat j gchoose k) = of_nat n + (1::'a) gchoose (k + 1) \<Longrightarrow> (\<Sum>j = 0..Suc n. of_nat j gchoose k) = of_nat (Suc n) + (1::'a) gchoose (k + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j = 0..n. of_nat j gchoose k) = of_nat n + (1::'a) gchoose (k + 1)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j = 0..n. of_nat j gchoose k) = of_nat n + (1::'a) gchoose (k + 1)

goal (1 subgoal):
 1. (\<Sum>j = 0..Suc n. of_nat j gchoose k) = of_nat (Suc n) + (1::'a) gchoose (k + 1)
[PROOF STEP]
using gbinomial_Suc_Suc[of "of_nat (Suc n) :: 'a" k]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j = 0..n. of_nat j gchoose k) = of_nat n + (1::'a) gchoose (k + 1)
of_nat (Suc n) + (1::'a) gchoose Suc k = of_nat (Suc n) gchoose k + (of_nat (Suc n) gchoose Suc k)

goal (1 subgoal):
 1. (\<Sum>j = 0..Suc n. of_nat j gchoose k) = of_nat (Suc n) + (1::'a) gchoose (k + 1)
[PROOF STEP]
by (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..Suc n. of_nat j gchoose k) = of_nat (Suc n) + (1::'a) gchoose (k + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma less_power_add_imp_div_less [simp]:
  fixes i m n:: nat
  assumes "i < 2^(m+n)"
  shows "i div 2^n < 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i div 2 ^ n < 2 ^ m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < 2 ^ (m + n)

goal (1 subgoal):
 1. i div 2 ^ n < 2 ^ m
[PROOF STEP]
by (simp add: less_mult_imp_div_less power_add)


[STATEMENT]
lemma int_less_real_le: "n < m \<longleftrightarrow> real_of_int n + 1 \<le> real_of_int m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n < m) = (real_of_int n + 1 \<le> real_of_int m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (n < m) = (real_of_int n + 1 \<le> real_of_int m)
[PROOF STEP]
have "(0::real) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> 1
[PROOF STEP]
by (metis less_eq_real_def zero_less_one)
[PROOF STATE]
proof (state)
this:
0 \<le> 1

goal (1 subgoal):
 1. (n < m) = (real_of_int n + 1 \<le> real_of_int m)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> 1

goal (1 subgoal):
 1. (n < m) = (real_of_int n + 1 \<le> real_of_int m)
[PROOF STEP]
by (metis floor_of_int less_floor_iff)
[PROOF STATE]
proof (state)
this:
(n < m) = (real_of_int n + 1 \<le> real_of_int m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in finite_measure) measure_eq_bigunion_image:
  assumes "range f \<subseteq> sets M" "range g \<subseteq> sets M"
  assumes "disjoint_family f" "disjoint_family g"
  assumes "\<And> n :: nat. measure M (f n) = measure M (g n)"
  shows "measure M (\<Union>i. f i) = measure M (\<Union>i. g i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M (\<Union> (range f)) = Sigma_Algebra.measure M (\<Union> (range g))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
range f \<subseteq> sets M
range g \<subseteq> sets M
disjoint_family f
disjoint_family g
Sigma_Algebra.measure M (f ?n) = Sigma_Algebra.measure M (g ?n)

goal (1 subgoal):
 1. Sigma_Algebra.measure M (\<Union> (range f)) = Sigma_Algebra.measure M (\<Union> (range g))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>range f \<subseteq> sets M; range g \<subseteq> sets M; disjoint_family f; disjoint_family g; \<And>n. Sigma_Algebra.measure M (f n) = Sigma_Algebra.measure M (g n)\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (\<Union> (range f)) = Sigma_Algebra.measure M (\<Union> (range g))
[PROOF STEP]
have a: "(\<lambda> i. measure M (f i)) sums (measure M (\<Union>i. f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (f i)) sums Sigma_Algebra.measure M (\<Union> (range f))
[PROOF STEP]
by (rule finite_measure_UNION[OF assms(1,3)])
[PROOF STATE]
proof (state)
this:
(\<lambda>i. Sigma_Algebra.measure M (f i)) sums Sigma_Algebra.measure M (\<Union> (range f))

goal (1 subgoal):
 1. \<lbrakk>range f \<subseteq> sets M; range g \<subseteq> sets M; disjoint_family f; disjoint_family g; \<And>n. Sigma_Algebra.measure M (f n) = Sigma_Algebra.measure M (g n)\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (\<Union> (range f)) = Sigma_Algebra.measure M (\<Union> (range g))
[PROOF STEP]
have b: "(\<lambda> i. measure M (g i)) sums (measure M (\<Union>i. g i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. Sigma_Algebra.measure M (g i)) sums Sigma_Algebra.measure M (\<Union> (range g))
[PROOF STEP]
by (rule finite_measure_UNION[OF assms(2,4)])
[PROOF STATE]
proof (state)
this:
(\<lambda>i. Sigma_Algebra.measure M (g i)) sums Sigma_Algebra.measure M (\<Union> (range g))

goal (1 subgoal):
 1. \<lbrakk>range f \<subseteq> sets M; range g \<subseteq> sets M; disjoint_family f; disjoint_family g; \<And>n. Sigma_Algebra.measure M (f n) = Sigma_Algebra.measure M (g n)\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (\<Union> (range f)) = Sigma_Algebra.measure M (\<Union> (range g))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M (\<Union> (range f)) = Sigma_Algebra.measure M (\<Union> (range g))
[PROOF STEP]
using sums_unique[OF b] sums_unique[OF a] assms
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M (\<Union> (range g)) = (\<Sum>i. Sigma_Algebra.measure M (g i))
Sigma_Algebra.measure M (\<Union> (range f)) = (\<Sum>i. Sigma_Algebra.measure M (f i))
range f \<subseteq> sets M
range g \<subseteq> sets M
disjoint_family f
disjoint_family g
Sigma_Algebra.measure M (f ?n) = Sigma_Algebra.measure M (g ?n)

goal (1 subgoal):
 1. Sigma_Algebra.measure M (\<Union> (range f)) = Sigma_Algebra.measure M (\<Union> (range g))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M (\<Union> (range f)) = Sigma_Algebra.measure M (\<Union> (range g))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma one_add_floor: "\<lfloor>x\<rfloor> + 1 = \<lfloor>x + 1\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>x\<rfloor> + 1 = \<lfloor>x + (1::'a)\<rfloor>
[PROOF STEP]
using floor_add_int [of x 1]
[PROOF STATE]
proof (prove)
using this:
\<lfloor>x\<rfloor> + 1 = \<lfloor>x + of_int 1\<rfloor>

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> + 1 = \<lfloor>x + (1::'a)\<rfloor>
[PROOF STEP]
by simp


[STATEMENT]
lemma bounded_sums:
  fixes S :: "'a::real_normed_vector set"
  assumes "bounded S" and "bounded T"
  shows "bounded (\<Union>x\<in> S. \<Union>y \<in> T. {x + y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bounded S
bounded T

goal (1 subgoal):
 1. bounded (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})
[PROOF STEP]
by (simp add: bounded_iff) (meson norm_triangle_mono)


[STATEMENT]
lemma diameter_ball [simp]:
  fixes a :: "'a::euclidean_space"
  shows "diameter(ball a r) = (if r < 0 then 0 else 2*r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diameter (ball a r) = (if r < 0 then 0 else 2 * r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. diameter (ball a r) = (if r < 0 then 0 else 2 * r)
[PROOF STEP]
have "diameter(ball a r) = 2*r" if "r > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diameter (ball a r) = 2 * r
[PROOF STEP]
by (metis bounded_ball diameter_closure closure_ball diameter_cball less_eq_real_def linorder_not_less that)
[PROOF STATE]
proof (state)
this:
0 < r \<Longrightarrow> diameter (ball a r) = 2 * r

goal (1 subgoal):
 1. diameter (ball a r) = (if r < 0 then 0 else 2 * r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < r \<Longrightarrow> diameter (ball a r) = 2 * r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < r \<Longrightarrow> diameter (ball a r) = 2 * r

goal (1 subgoal):
 1. diameter (ball a r) = (if r < 0 then 0 else 2 * r)
[PROOF STEP]
by (simp add: diameter_def)
[PROOF STATE]
proof (state)
this:
diameter (ball a r) = (if r < 0 then 0 else 2 * r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma triangle_points_closer:
  fixes a::complex
  shows "\<lbrakk>x \<in> convex hull {a,b,c};  y \<in> convex hull {a,b,c}\<rbrakk>
         \<Longrightarrow> norm(x - y) \<le> norm(a - b) \<or>
             norm(x - y) \<le> norm(b - c) \<or>
             norm(x - y) \<le> norm(c - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> convex hull {a, b, c}; y \<in> convex hull {a, b, c}\<rbrakk> \<Longrightarrow> cmod (x - y) \<le> cmod (a - b) \<or> cmod (x - y) \<le> cmod (b - c) \<or> cmod (x - y) \<le> cmod (c - a)
[PROOF STEP]
using simplex_extremal_le [of "{a,b,c}"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {a, b, c}; {a, b, c} \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>{a, b, c}. \<exists>v\<in>{a, b, c}. \<forall>x\<in>convex hull {a, b, c}. \<forall>y\<in>convex hull {a, b, c}. cmod (x - y) \<le> cmod (u - v)

goal (1 subgoal):
 1. \<lbrakk>x \<in> convex hull {a, b, c}; y \<in> convex hull {a, b, c}\<rbrakk> \<Longrightarrow> cmod (x - y) \<le> cmod (a - b) \<or> cmod (x - y) \<le> cmod (b - c) \<or> cmod (x - y) \<le> cmod (c - a)
[PROOF STEP]
by (auto simp: norm_minus_commute)


[STATEMENT]
lemma has_contour_integral_bound_linepath:
  assumes "(f has_contour_integral i) (linepath a b)"
          "0 \<le> B" and B: "\<And>x. x \<in> closed_segment a b \<Longrightarrow> norm(f x) \<le> B"
    shows "norm i \<le> B * norm(b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod i \<le> B * cmod (b - a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod i \<le> B * cmod (b - a)
[PROOF STEP]
have "norm i \<le> (B * norm (b - a)) * content (cbox 0 (1::real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod i \<le> B * cmod (b - a) * content (cbox 0 1)
[PROOF STEP]
proof (rule has_integral_bound
       [of _ "\<lambda>x. f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})"])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 \<le> B * cmod (b - a)
 2. ((\<lambda>x. f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})) has_integral i) (cbox 0 1)
 3. \<And>x. x \<in> cbox 0 1 \<Longrightarrow> cmod (f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})) \<le> B * cmod (b - a)
[PROOF STEP]
show  "cmod (f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1}))
         \<le> B * cmod (b - a)"
      if "x \<in> cbox 0 1" for x::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})) \<le> B * cmod (b - a)
[PROOF STEP]
using that box_real(2) norm_mult
[PROOF STATE]
proof (prove)
using this:
x \<in> cbox 0 1
cbox ?a ?b = {?a..?b}
norm (?x * ?y) = norm ?x * norm ?y

goal (1 subgoal):
 1. cmod (f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})) \<le> B * cmod (b - a)
[PROOF STEP]
by (metis B linepath_in_path mult_right_mono norm_ge_zero vector_derivative_linepath_within)
[PROOF STATE]
proof (state)
this:
?x \<in> cbox 0 1 \<Longrightarrow> cmod (f (linepath a b ?x) * vector_derivative (linepath a b) (at ?x within {0..1})) \<le> B * cmod (b - a)

goal (2 subgoals):
 1. 0 \<le> B * cmod (b - a)
 2. ((\<lambda>x. f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})) has_integral i) (cbox 0 1)
[PROOF STEP]
qed (use assms has_contour_integral_def in auto)
[PROOF STATE]
proof (state)
this:
cmod i \<le> B * cmod (b - a) * content (cbox 0 1)

goal (1 subgoal):
 1. cmod i \<le> B * cmod (b - a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod i \<le> B * cmod (b - a) * content (cbox 0 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod i \<le> B * cmod (b - a) * content (cbox 0 1)

goal (1 subgoal):
 1. cmod i \<le> B * cmod (b - a)
[PROOF STEP]
by (auto simp: content_real)
[PROOF STATE]
proof (state)
this:
cmod i \<le> B * cmod (b - a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gchoose_row_sum_weighted:
  "(\<Sum>k = 0..m. (r gchoose k) * (r/2 - of_nat k)) = of_nat(Suc m) / 2 * (r gchoose (Suc m))"
  for r :: "'a::field_char_0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..m. (r gchoose k) * (r / (2::'a) - of_nat k)) = of_nat (Suc m) / (2::'a) * (r gchoose Suc m)
[PROOF STEP]
by (induct m) (simp_all add: field_simps distrib gbinomial_mult_1)


[STATEMENT]
theorem rqs_cost_exp_eq [code]: "rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
define F where "F = (\<lambda>n. rqs_cost_exp n / (real n + 1))"
[PROOF STATE]
proof (state)
this:
F = (\<lambda>n. rqs_cost_exp n / (real n + 1))

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
have [simp]: "F 0 = 0" "F (Suc 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F 0 = 0 &&& F (Suc 0) = 0
[PROOF STEP]
by (simp_all add: F_def)
[PROOF STATE]
proof (state)
this:
F 0 = 0
F (Suc 0) = 0

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
have F_Suc: "F (Suc m) = F m + real (2*m) / (real ((m+1)*(m+2)))" if "m > 0" for m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
proof (cases m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = 0 \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
 2. \<And>nat. m = Suc nat \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
m = Suc n

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
 2. \<And>nat. m = Suc nat \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
have A: "rqs_cost_exp (Suc (Suc n)) * real (Suc (Suc n)) =
            real ((n+1)*(n+2)) + 2 * (\<Sum>i\<le>n. rqs_cost_exp i) + 2 * rqs_cost_exp (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rqs_cost_exp (Suc (Suc n)) * real (Suc (Suc n)) = real ((n + 1) * (n + 2)) + 2 * sum rqs_cost_exp {..n} + 2 * rqs_cost_exp (Suc n)
[PROOF STEP]
by (subst rqs_cost_exp_Suc') (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
rqs_cost_exp (Suc (Suc n)) * real (Suc (Suc n)) = real ((n + 1) * (n + 2)) + 2 * sum rqs_cost_exp {..n} + 2 * rqs_cost_exp (Suc n)

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
 2. \<And>nat. m = Suc nat \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
have B: "rqs_cost_exp (Suc n) * real (Suc n) = real (n*(n+1)) + 2 * (\<Sum>i\<le>n. rqs_cost_exp i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rqs_cost_exp (Suc n) * real (Suc n) = real (n * (n + 1)) + 2 * sum rqs_cost_exp {..n}
[PROOF STEP]
by (subst rqs_cost_exp_Suc') (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
rqs_cost_exp (Suc n) * real (Suc n) = real (n * (n + 1)) + 2 * sum rqs_cost_exp {..n}

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
 2. \<And>nat. m = Suc nat \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
have "rqs_cost_exp (Suc (Suc n)) * real (Suc (Suc n)) - rqs_cost_exp (Suc n) * real (Suc n) =
            real ((n+1)*(n+2)) - real (n*(n+1)) + 2 * rqs_cost_exp (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rqs_cost_exp (Suc (Suc n)) * real (Suc (Suc n)) - rqs_cost_exp (Suc n) * real (Suc n) = real ((n + 1) * (n + 2)) - real (n * (n + 1)) + 2 * rqs_cost_exp (Suc n)
[PROOF STEP]
by (subst A, subst B) simp_all
[PROOF STATE]
proof (state)
this:
rqs_cost_exp (Suc (Suc n)) * real (Suc (Suc n)) - rqs_cost_exp (Suc n) * real (Suc n) = real ((n + 1) * (n + 2)) - real (n * (n + 1)) + 2 * rqs_cost_exp (Suc n)

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
 2. \<And>nat. m = Suc nat \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rqs_cost_exp (Suc (Suc n)) * real (Suc (Suc n)) - rqs_cost_exp (Suc n) * real (Suc n) = real ((n + 1) * (n + 2)) - real (n * (n + 1)) + 2 * rqs_cost_exp (Suc n)

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
 2. \<And>nat. m = Suc nat \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
have "real ((n+1)*(n+2)) - real (n*(n+1)) = real (2*(n+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real ((n + 1) * (n + 2)) - real (n * (n + 1)) = real (2 * (n + 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real ((n + 1) * (n + 2)) - real (n * (n + 1)) = real (2 * (n + 1))

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
 2. \<And>nat. m = Suc nat \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rqs_cost_exp (Suc (Suc n)) * real (Suc (Suc n)) - rqs_cost_exp (Suc n) * real (Suc n) = real (2 * (n + 1)) + 2 * rqs_cost_exp (Suc n)
[PROOF STEP]
have "rqs_cost_exp (Suc (Suc n)) * real (n+2) = rqs_cost_exp (Suc n) * real (n+3) + real (2*(n+1))"
[PROOF STATE]
proof (prove)
using this:
rqs_cost_exp (Suc (Suc n)) * real (Suc (Suc n)) - rqs_cost_exp (Suc n) * real (Suc n) = real (2 * (n + 1)) + 2 * rqs_cost_exp (Suc n)

goal (1 subgoal):
 1. rqs_cost_exp (Suc (Suc n)) * real (n + 2) = rqs_cost_exp (Suc n) * real (n + 3) + real (2 * (n + 1))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
rqs_cost_exp (Suc (Suc n)) * real (n + 2) = rqs_cost_exp (Suc n) * real (n + 3) + real (2 * (n + 1))

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
 2. \<And>nat. m = Suc nat \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
hence "rqs_cost_exp (Suc (Suc n)) / real (n+3) =
             rqs_cost_exp (Suc n) / real (n+2) + real (2*(n+1)) / (real (n+2)*real (n+3))"
[PROOF STATE]
proof (prove)
using this:
rqs_cost_exp (Suc (Suc n)) * real (n + 2) = rqs_cost_exp (Suc n) * real (n + 3) + real (2 * (n + 1))

goal (1 subgoal):
 1. rqs_cost_exp (Suc (Suc n)) / real (n + 3) = rqs_cost_exp (Suc n) / real (n + 2) + real (2 * (n + 1)) / (real (n + 2) * real (n + 3))
[PROOF STEP]
by (simp add: divide_simps del: of_nat_Suc of_nat_add)
[PROOF STATE]
proof (state)
this:
rqs_cost_exp (Suc (Suc n)) / real (n + 3) = rqs_cost_exp (Suc n) / real (n + 2) + real (2 * (n + 1)) / (real (n + 2) * real (n + 3))

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
 2. \<And>nat. m = Suc nat \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
rqs_cost_exp (Suc (Suc n)) / real (n + 3) = rqs_cost_exp (Suc n) / real (n + 2) + real (2 * (n + 1)) / (real (n + 2) * real (n + 3))

goal (1 subgoal):
 1. F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
by (simp add: F_def algebra_simps Suc)
[PROOF STATE]
proof (state)
this:
F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))

goal (1 subgoal):
 1. m = 0 \<Longrightarrow> F (Suc m) = F m + real (2 * m) / real ((m + 1) * (m + 2))
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
0 < ?m \<Longrightarrow> F (Suc ?m) = F ?m + real (2 * ?m) / real ((?m + 1) * (?m + 2))

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
have F_eq: "F n = 2 * (\<Sum>k=1..n. real (k - 1) / real (k * (k + 1)))" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F n = 2 * (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1)))
[PROOF STEP]
proof (cases "n \<ge> 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 \<le> n \<Longrightarrow> F n = 2 * (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1)))
 2. \<not> 1 \<le> n \<Longrightarrow> F n = 2 * (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
1 \<le> n

goal (2 subgoals):
 1. 1 \<le> n \<Longrightarrow> F n = 2 * (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1)))
 2. \<not> 1 \<le> n \<Longrightarrow> F n = 2 * (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. F n = 2 * (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1)))
[PROOF STEP]
by (induction n rule: dec_induct) (simp_all add: F_Suc algebra_simps)
[PROOF STATE]
proof (state)
this:
F n = 2 * (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1)))

goal (1 subgoal):
 1. \<not> 1 \<le> n \<Longrightarrow> F n = 2 * (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1)))
[PROOF STEP]
qed (simp_all add: not_le)
[PROOF STATE]
proof (state)
this:
F ?n = 2 * (\<Sum>k = 1..?n. real (k - 1) / real (k * (k + 1)))

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
have "F n = 2 * (\<Sum>k=1..n. real (k - 1) / real (k * (k + 1)))" (is "_ = 2 * ?S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F n = 2 * (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1)))
[PROOF STEP]
by (fact F_eq)
[PROOF STATE]
proof (state)
this:
F n = 2 * (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1)))

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
F n = 2 * (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1)))

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
have "?S = (\<Sum>k=1..n. 2 / real (Suc k) - 1 / real k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1))) = (\<Sum>k = 1..n. 2 / real (Suc k) - 1 / real k)
[PROOF STEP]
by (intro sum.cong) (simp_all add: field_simps of_nat_diff)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1))) = (\<Sum>k = 1..n. 2 / real (Suc k) - 1 / real k)

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. real (k - 1) / real (k * (k + 1))) = (\<Sum>k = 1..n. 2 / real (Suc k) - 1 / real k)

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
have "\<dots> = 2 * (\<Sum>k=1..n. inverse (real (Suc k))) - harm n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. 2 / real (Suc k) - 1 / real k) = 2 * (\<Sum>k = 1..n. inverse (real (Suc k))) - harm n
[PROOF STEP]
by (subst sum_subtractf) (simp add: harm_def sum.distrib sum_distrib_left divide_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. 2 / real (Suc k) - 1 / real k) = 2 * (\<Sum>k = 1..n. inverse (real (Suc k))) - harm n

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. 2 / real (Suc k) - 1 / real k) = 2 * (\<Sum>k = 1..n. inverse (real (Suc k))) - harm n

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
have "(\<Sum>k=1..n. inverse (real (Suc k))) = (\<Sum>k=Suc 1..Suc n. inverse (real k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. inverse (real (Suc k))) = (\<Sum>k = Suc 1..Suc n. inverse (real k))
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "\<lambda>x. x - 1" Suc]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. inverse (real (Suc k))) = (\<Sum>k = Suc 1..Suc n. inverse (real k))

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. inverse (real (Suc k))) = (\<Sum>k = Suc 1..Suc n. inverse (real k))

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
have "\<dots> = harm (Suc n) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = Suc 1..Suc n. inverse (real k)) = harm (Suc n) - 1
[PROOF STEP]
unfolding harm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = Suc 1..Suc n. inverse (real k)) = (\<Sum>k = 1..Suc n. inverse (real k)) - 1
[PROOF STEP]
by (subst (2) sum.atLeast_Suc_atMost) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>k = Suc 1..Suc n. inverse (real k)) = harm (Suc n) - 1

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
F n = 2 * (2 * (harm (Suc n) - 1) - harm n)
[PROOF STEP]
have "F n = 2 * harm n + 4 * (1 / (n + 1) - 1)"
[PROOF STATE]
proof (prove)
using this:
F n = 2 * (2 * (harm (Suc n) - 1) - harm n)

goal (1 subgoal):
 1. F n = 2 * harm n + 4 * (1 / real (n + 1) - 1)
[PROOF STEP]
by (simp add: harm_Suc field_simps)
[PROOF STATE]
proof (state)
this:
F n = 2 * harm n + 4 * (1 / real (n + 1) - 1)

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
F n = 2 * harm n + 4 * (1 / real (n + 1) - 1)

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
have "\<dots> * real (n + 1) = 2 * real (n + 1) * harm n - 4 * real n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * harm n + 4 * (1 / real (n + 1) - 1)) * real (n + 1) = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(2 * harm n + 4 * (1 / real (n + 1) - 1)) * real (n + 1) = 2 * real (n + 1) * harm n - 4 * real n

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2 * harm n + 4 * (1 / real (n + 1) - 1)) * real (n + 1) = 2 * real (n + 1) * harm n - 4 * real n

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
have "F n * real (n + 1) = rqs_cost_exp n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F n * real (n + 1) = rqs_cost_exp n
[PROOF STEP]
by (simp add: F_def add_ac)
[PROOF STATE]
proof (state)
this:
F n * real (n + 1) = rqs_cost_exp n

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n

goal (1 subgoal):
 1. rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rqs_cost_exp n = 2 * real (n + 1) * harm n - 4 * real n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_sameprod: "finite X \<Longrightarrow> card (X^\<two>) = card X choose 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite X \<Longrightarrow> card X^\<two> = card X choose 2
[PROOF STEP]
unfolding sameprod_altdef
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite X \<Longrightarrow> card {Y. Y \<subseteq> X \<and> card Y = 2} = card X choose 2
[PROOF STEP]
by (subst n_subsets, auto)


[STATEMENT]
lemma dim_left_null_space[code_unfold]:
  fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
  shows "vec.dim (left_null_space A) = (vec.dimension TYPE('a) TYPE('rows)) - rank (A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (left_null_space A) = finite_dimensional_vector_space.dimension cart_basis - rank A
[PROOF STEP]
unfolding left_null_space_eq_null_space_transpose
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (null_space (Finite_Cartesian_Product.transpose A)) = finite_dimensional_vector_space.dimension cart_basis - rank A
[PROOF STEP]
unfolding dim_null_space
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_dimensional_vector_space.dimension cart_basis - rank (Finite_Cartesian_Product.transpose A) = finite_dimensional_vector_space.dimension cart_basis - rank A
[PROOF STEP]
unfolding rank_transpose
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_dimensional_vector_space.dimension cart_basis - rank A = finite_dimensional_vector_space.dimension cart_basis - rank A
[PROOF STEP]
..


[STATEMENT]
lemma permutation_mat_both: assumes A: "A \<in> carrier_mat n n" and p: "p permutes {..<n}"
  shows "permutation_mat n p * Matrix.mat n n (\<lambda> (i,j). A $$ (p i, p j)) * permutation_mat n (inv p) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutation_mat n p * Matrix.mat n n (\<lambda>(i, j). A $$ (p i, p j)) * permutation_mat n (inv p) = A
[PROOF STEP]
unfolding permutation_mat_left[OF mat_carrier p]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat n n (\<lambda>(i, j). Matrix.mat n n (\<lambda>(i, j). A $$ (p i, p j)) $$ (inv p i, j)) * permutation_mat n (inv p) = A
[PROOF STEP]
by (subst permutation_mat_right[OF _ permutes_inv[OF p], of _ n], force, insert A p,
        auto intro!: eq_matI simp: permutes_inverses permutes_lt[OF permutes_inv[OF p]])


[STATEMENT]
lemma card_funcsetE: "finite A \<Longrightarrow> card (A \<rightarrow>\<^sub>E B) = card B ^ card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> card (A \<rightarrow>\<^sub>E B) = card B ^ card A
[PROOF STEP]
by (subst card_PiE, auto)


[STATEMENT]
lemma periodic_arithmetic_sum_periodic_arithmetic:
  assumes "periodic_arithmetic f k"
  shows "(\<Sum>l \<in> {m..n}. f l) = (\<Sum>l \<in> {m+k..n+k}. f l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {m..n} = sum f {m + k..n + k}
[PROOF STEP]
using periodic_arithmetic_def assms
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic ?f ?k = (\<forall>n. ?f (n + ?k) = ?f n)
periodic_arithmetic f k

goal (1 subgoal):
 1. sum f {m..n} = sum f {m + k..n + k}
[PROOF STEP]
by (intro sum.reindex_bij_witness
         [of "{m..n}" "\<lambda>l. l-k" "\<lambda>l. l+k" "{m+k..n+k}" f f])
      auto


[STATEMENT]
lemma integral_std_normal_moment_abs_odd:
  "integral\<^sup>L lborel (\<lambda>x. std_normal_density x * \<bar>x\<bar>^(2 * k + 1)) = sqrt (2 / pi) * 2^k * fact k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. std_normal_density x * \<bar>x\<bar> ^ (2 * k + 1) = sqrt (2 / pi) * 2 ^ k * fact k
[PROOF STEP]
using std_normal_moment_abs_odd
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral lborel (\<lambda>x. std_normal_density x * \<bar>x\<bar> ^ (2 * k + 1)) (sqrt (2 / pi) * 2 ^ k * fact k)

goal (1 subgoal):
 1. LBINT x. std_normal_density x * \<bar>x\<bar> ^ (2 * k + 1) = sqrt (2 / pi) * 2 ^ k * fact k
[PROOF STEP]
by (rule has_bochner_integral_integral_eq)


[STATEMENT]
lemma ennreal_prod_eq_top:
  fixes f :: "'a \<Rightarrow> ennreal"
  shows "(\<Prod>i\<in>I. f i) = top \<longleftrightarrow> (finite I \<and> ((\<forall>i\<in>I. f i \<noteq> 0) \<and> (\<exists>i\<in>I. f i = top)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (prod f I = top) = (finite I \<and> (\<forall>i\<in>I. f i \<noteq> 0) \<and> (\<exists>i\<in>I. f i = top))
[PROOF STEP]
by (induction I rule: infinite_finite_induct) (auto simp: ennreal_mult_eq_top_iff)


[STATEMENT]
lemma Arg_minus:
  assumes "z \<noteq> 0"
  shows "Arg (-z) = (if Arg z \<le> 0 then Arg z + pi else Arg z - pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arg (- z) = (if Arg z \<le> 0 then Arg z + pi else Arg z - pi)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Arg (- z) = (if Arg z \<le> 0 then Arg z + pi else Arg z - pi)
[PROOF STEP]
have [simp]: "cmod z * cos (Arg z) = Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod z * cos (Arg z) = Re z
[PROOF STEP]
using assms Arg_eq [of z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0
z \<noteq> 0 \<Longrightarrow> z = complex_of_real (cmod z) * exp (\<i> * complex_of_real (Arg z))

goal (1 subgoal):
 1. cmod z * cos (Arg z) = Re z
[PROOF STEP]
by (metis Re_exp exp_Ln norm_exp_eq_Re Arg_def)
[PROOF STATE]
proof (state)
this:
cmod z * cos (Arg z) = Re z

goal (1 subgoal):
 1. Arg (- z) = (if Arg z \<le> 0 then Arg z + pi else Arg z - pi)
[PROOF STEP]
have [simp]: "cmod z * sin (Arg z) = Im z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod z * sin (Arg z) = Im z
[PROOF STEP]
using assms Arg_eq [of z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0
z \<noteq> 0 \<Longrightarrow> z = complex_of_real (cmod z) * exp (\<i> * complex_of_real (Arg z))

goal (1 subgoal):
 1. cmod z * sin (Arg z) = Im z
[PROOF STEP]
by (metis Im_exp exp_Ln norm_exp_eq_Re Arg_def)
[PROOF STATE]
proof (state)
this:
cmod z * sin (Arg z) = Im z

goal (1 subgoal):
 1. Arg (- z) = (if Arg z \<le> 0 then Arg z + pi else Arg z - pi)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arg (- z) = (if Arg z \<le> 0 then Arg z + pi else Arg z - pi)
[PROOF STEP]
apply (rule Arg_unique [of "norm z", OF complex_eqI])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. Re (complex_of_real (cmod z) * exp (\<i> * complex_of_real (if Arg z \<le> 0 then Arg z + pi else Arg z - pi))) = Re (- z)
 2. Im (complex_of_real (cmod z) * exp (\<i> * complex_of_real (if Arg z \<le> 0 then Arg z + pi else Arg z - pi))) = Im (- z)
 3. 0 < cmod z
 4. - pi < (if Arg z \<le> 0 then Arg z + pi else Arg z - pi)
 5. (if Arg z \<le> 0 then Arg z + pi else Arg z - pi) \<le> pi
[PROOF STEP]
using mpi_less_Arg [of z] Arg_le_pi [of z] assms
[PROOF STATE]
proof (prove)
using this:
- pi < Arg z
Arg z \<le> pi
z \<noteq> 0

goal (5 subgoals):
 1. Re (complex_of_real (cmod z) * exp (\<i> * complex_of_real (if Arg z \<le> 0 then Arg z + pi else Arg z - pi))) = Re (- z)
 2. Im (complex_of_real (cmod z) * exp (\<i> * complex_of_real (if Arg z \<le> 0 then Arg z + pi else Arg z - pi))) = Im (- z)
 3. 0 < cmod z
 4. - pi < (if Arg z \<le> 0 then Arg z + pi else Arg z - pi)
 5. (if Arg z \<le> 0 then Arg z + pi else Arg z - pi) \<le> pi
[PROOF STEP]
by (auto simp: Re_exp Im_exp)
[PROOF STATE]
proof (state)
this:
Arg (- z) = (if Arg z \<le> 0 then Arg z + pi else Arg z - pi)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_single:
  assumes "finite A"
  assumes "\<And>j. j \<noteq> i \<Longrightarrow> j\<in>A \<Longrightarrow> f j = 0"
  shows "sum f A = (if i\<in>A then f i else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f A = (if i \<in> A then f i else (0::'b))
[PROOF STEP]
apply (subst sum.mono_neutral_cong_right[where S=\<open>A \<inter> {i}\<close> and h=f])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. finite A
 2. A \<inter> {i} \<subseteq> A
 3. \<forall>i\<in>A - A \<inter> {i}. f i = (0::'b)
 4. \<And>x. x \<in> A \<inter> {i} \<Longrightarrow> f x = f x
 5. sum f (A \<inter> {i}) = (if i \<in> A then f i else (0::'b))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
\<lbrakk>?j \<noteq> i; ?j \<in> A\<rbrakk> \<Longrightarrow> f ?j = (0::'b)

goal (5 subgoals):
 1. finite A
 2. A \<inter> {i} \<subseteq> A
 3. \<forall>i\<in>A - A \<inter> {i}. f i = (0::'b)
 4. \<And>x. x \<in> A \<inter> {i} \<Longrightarrow> f x = f x
 5. sum f (A \<inter> {i}) = (if i \<in> A then f i else (0::'b))
[PROOF STEP]
by auto


[STATEMENT]
lemma relative_polar_form_eq:
  "Q + dist P Q *\<^sub>R of_radiant (radiant_of (P - Q)) = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q + dist P Q *\<^sub>R of_radiant (radiant_of (P - Q)) = P
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Q + dist P Q *\<^sub>R of_radiant (radiant_of (P - Q)) = P
[PROOF STEP]
have "norm (P - Q) *\<^sub>R of_radiant (radiant_of (P - Q)) = P - Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (P - Q) *\<^sub>R of_radiant (radiant_of (P - Q)) = P - Q
[PROOF STEP]
unfolding polar_form_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P - Q = P - Q
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
norm (P - Q) *\<^sub>R of_radiant (radiant_of (P - Q)) = P - Q

goal (1 subgoal):
 1. Q + dist P Q *\<^sub>R of_radiant (radiant_of (P - Q)) = P
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
norm (P - Q) *\<^sub>R of_radiant (radiant_of (P - Q)) = P - Q

goal (1 subgoal):
 1. Q + dist P Q *\<^sub>R of_radiant (radiant_of (P - Q)) = P
[PROOF STEP]
have "dist P Q = norm (P - Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist P Q = norm (P - Q)
[PROOF STEP]
by (simp add: dist_norm)
[PROOF STATE]
proof (state)
this:
dist P Q = norm (P - Q)

goal (1 subgoal):
 1. Q + dist P Q *\<^sub>R of_radiant (radiant_of (P - Q)) = P
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
norm (P - Q) *\<^sub>R of_radiant (radiant_of (P - Q)) = P - Q
dist P Q = norm (P - Q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (P - Q) *\<^sub>R of_radiant (radiant_of (P - Q)) = P - Q
dist P Q = norm (P - Q)

goal (1 subgoal):
 1. Q + dist P Q *\<^sub>R of_radiant (radiant_of (P - Q)) = P
[PROOF STEP]
by (metis add.commute diff_add_cancel)
[PROOF STATE]
proof (state)
this:
Q + dist P Q *\<^sub>R of_radiant (radiant_of (P - Q)) = P

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tensor_smult0: fixes A::"'a::ring tensor"
shows "0 \<cdot> A = tensor0 (dims A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<cdot> A = tensor0 (dims A)
[PROOF STEP]
unfolding smult_def tensor0_def vec_smult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_from_vec (dims A) (map ((*) (0::'a)) (vec A)) = tensor_from_vec (dims A) (vec0 (prod_list (dims A)))
[PROOF STEP]
using vec_smult0 length_vec
[PROOF STATE]
proof (prove)
using this:
vec_smult (0::?'a) ?as = vec0 (length ?as)
length (vec ?A) = prod_list (dims ?A)

goal (1 subgoal):
 1. tensor_from_vec (dims A) (map ((*) (0::'a)) (vec A)) = tensor_from_vec (dims A) (vec0 (prod_list (dims A)))
[PROOF STEP]
by (metis (no_types) vec_smult_def)


[STATEMENT]
lemma norm_vec_le_norm_bfun:
  "norm (vec_lambda (apply_bfun (x :: 'd::finite \<Rightarrow>\<^sub>b real))) \<le> norm x * card (UNIV :: 'd set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (vec_lambda (apply_bfun x)) \<le> norm x * real CARD('d)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (vec_lambda (apply_bfun x)) \<le> norm x * real CARD('d)
[PROOF STEP]
have "norm (vec_lambda (apply_bfun x)) \<le> (\<Sum> i \<in> UNIV . \<bar>(apply_bfun x i)\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (vec_lambda (apply_bfun x)) \<le> (\<Sum>i\<in>UNIV. \<bar>apply_bfun x i\<bar>)
[PROOF STEP]
using L2_set_le_sum_abs
[PROOF STATE]
proof (prove)
using this:
L2_set ?f ?A \<le> (\<Sum>i\<in>?A. \<bar>?f i\<bar>)

goal (1 subgoal):
 1. norm (vec_lambda (apply_bfun x)) \<le> (\<Sum>i\<in>UNIV. \<bar>apply_bfun x i\<bar>)
[PROOF STEP]
unfolding norm_vec_def L2_set_def
[PROOF STATE]
proof (prove)
using this:
sqrt (\<Sum>i\<in>?A. (?f i)\<^sup>2) \<le> (\<Sum>i\<in>?A. \<bar>?f i\<bar>)

goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>UNIV. (norm (vec_lambda (apply_bfun x) $ i))\<^sup>2) \<le> (\<Sum>i\<in>UNIV. \<bar>apply_bfun x i\<bar>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm (vec_lambda (apply_bfun x)) \<le> (\<Sum>i\<in>UNIV. \<bar>apply_bfun x i\<bar>)

goal (1 subgoal):
 1. norm (vec_lambda (apply_bfun x)) \<le> norm x * real CARD('d)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (vec_lambda (apply_bfun x)) \<le> (\<Sum>i\<in>UNIV. \<bar>apply_bfun x i\<bar>)

goal (1 subgoal):
 1. norm (vec_lambda (apply_bfun x)) \<le> norm x * real CARD('d)
[PROOF STEP]
have "\<dots> \<le> (card (UNIV :: 'd set) * (\<Squnion>xa. \<bar>apply_bfun x xa\<bar>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. \<bar>apply_bfun x i\<bar>) \<le> real CARD('d) * (\<Squnion>xa. \<bar>apply_bfun x xa\<bar>)
[PROOF STEP]
by (auto intro!: sum_bounded_above cSup_upper)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. \<bar>apply_bfun x i\<bar>) \<le> real CARD('d) * (\<Squnion>xa. \<bar>apply_bfun x xa\<bar>)

goal (1 subgoal):
 1. norm (vec_lambda (apply_bfun x)) \<le> norm x * real CARD('d)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (vec_lambda (apply_bfun x)) \<le> real CARD('d) * (\<Squnion>xa. \<bar>apply_bfun x xa\<bar>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (vec_lambda (apply_bfun x)) \<le> real CARD('d) * (\<Squnion>xa. \<bar>apply_bfun x xa\<bar>)

goal (1 subgoal):
 1. norm (vec_lambda (apply_bfun x)) \<le> norm x * real CARD('d)
[PROOF STEP]
by (simp add: norm_bfun_def dist_bfun_def mult.commute)
[PROOF STATE]
proof (state)
this:
norm (vec_lambda (apply_bfun x)) \<le> norm x * real CARD('d)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_complementary:
  "card (ceros_of_boolean_input v)
    + card {x. x < (dim_vec v) \<and> (vec_index v x = True)} = (dim_vec v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (ceros_of_boolean_input v) + card {x. x < dim_vec v \<and> v $ x = True} = dim_vec v
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x. x < dim_vec v \<and> v $ x = False} + card {x. x < dim_vec v \<and> v $ x = True} = dim_vec v
[PROOF STEP]
using card_UNIV_union [of v]
[PROOF STATE]
proof (prove)
using this:
card {x. x < dim_vec v \<and> v $ x = True} + card {x. x < dim_vec v \<and> v $ x = False} = card {x. x < dim_vec v}

goal (1 subgoal):
 1. card {x. x < dim_vec v \<and> v $ x = False} + card {x. x < dim_vec v \<and> v $ x = True} = dim_vec v
[PROOF STEP]
by simp


[STATEMENT]
lemma row_space_subset_span_basis_row_space:
fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
shows "row_space A \<subseteq> vec.span (basis_row_space A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_space A \<subseteq> vec.span (basis_row_space A)
[PROOF STEP]
proof (rule vec.card_ge_dim_independent)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. basis_row_space A \<subseteq> row_space A
 2. vec.independent (basis_row_space A)
 3. vec.dim (row_space A) \<le> card (basis_row_space A)
[PROOF STEP]
show "basis_row_space A \<subseteq> row_space A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_row_space A \<subseteq> row_space A
[PROOF STEP]
by (rule basis_row_space_subset_row_space)
[PROOF STATE]
proof (state)
this:
basis_row_space A \<subseteq> row_space A

goal (2 subgoals):
 1. vec.independent (basis_row_space A)
 2. vec.dim (row_space A) \<le> card (basis_row_space A)
[PROOF STEP]
show "vec.independent (basis_row_space A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent (basis_row_space A)
[PROOF STEP]
unfolding basis_row_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0}
[PROOF STEP]
by (rule independent_not_zero_rows_rref[OF rref_Gauss_Jordan])
[PROOF STATE]
proof (state)
this:
vec.independent (basis_row_space A)

goal (1 subgoal):
 1. vec.dim (row_space A) \<le> card (basis_row_space A)
[PROOF STEP]
show "vec.dim (row_space A) \<le> card (basis_row_space A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (row_space A) \<le> card (basis_row_space A)
[PROOF STEP]
unfolding basis_row_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (row_space A) \<le> card {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0}
[PROOF STEP]
using rref_rank[OF rref_Gauss_Jordan, of A]
[PROOF STATE]
proof (prove)
using this:
rank (Gauss_Jordan A) = card {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0}

goal (1 subgoal):
 1. vec.dim (row_space A) \<le> card {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0}
[PROOF STEP]
unfolding row_rank_def[symmetric] rank_def[symmetric] rank_Gauss_Jordan[symmetric]
[PROOF STATE]
proof (prove)
using this:
rank A = card {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0}

goal (1 subgoal):
 1. rank A \<le> card {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
vec.dim (row_space A) \<le> card (basis_row_space A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma count_vec_alt: "count_vec v x = card { i. v $ i = x \<and> i< dim_vec v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_vec v x = card {i. v $ i = x \<and> i < dim_vec v}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. count_vec v x = card {i. v $ i = x \<and> i < dim_vec v}
[PROOF STEP]
have "count_vec v x = count (image_mset (($) v) (mset_set {..<dim_vec v})) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_vec v x = count (image_mset (($) v) (mset_set {..<dim_vec v})) x
[PROOF STEP]
by (simp add: vec_mset_def)
[PROOF STATE]
proof (state)
this:
count_vec v x = count (image_mset (($) v) (mset_set {..<dim_vec v})) x

goal (1 subgoal):
 1. count_vec v x = card {i. v $ i = x \<and> i < dim_vec v}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count_vec v x = count (image_mset (($) v) (mset_set {..<dim_vec v})) x

goal (1 subgoal):
 1. count_vec v x = card {i. v $ i = x \<and> i < dim_vec v}
[PROOF STEP]
have "... = size {#a \<in># (image_mset (($) v) (mset_set {..<dim_vec v})) . x = a#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (image_mset (($) v) (mset_set {..<dim_vec v})) x = size (filter_mset ((=) x) (image_mset (($) v) (mset_set {..<dim_vec v})))
[PROOF STEP]
by (simp add: filter_mset_eq)
[PROOF STATE]
proof (state)
this:
count (image_mset (($) v) (mset_set {..<dim_vec v})) x = size (filter_mset ((=) x) (image_mset (($) v) (mset_set {..<dim_vec v})))

goal (1 subgoal):
 1. count_vec v x = card {i. v $ i = x \<and> i < dim_vec v}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count (image_mset (($) v) (mset_set {..<dim_vec v})) x = size (filter_mset ((=) x) (image_mset (($) v) (mset_set {..<dim_vec v})))

goal (1 subgoal):
 1. count_vec v x = card {i. v $ i = x \<and> i < dim_vec v}
[PROOF STEP]
have "... = size {#a \<in># (mset_set {..<dim_vec v}) . x = (v $ a) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (filter_mset ((=) x) (image_mset (($) v) (mset_set {..<dim_vec v}))) = size {#a \<in># mset_set {..<dim_vec v}. x = v $ a#}
[PROOF STEP]
by (simp add: filter_mset_image_mset)
[PROOF STATE]
proof (state)
this:
size (filter_mset ((=) x) (image_mset (($) v) (mset_set {..<dim_vec v}))) = size {#a \<in># mset_set {..<dim_vec v}. x = v $ a#}

goal (1 subgoal):
 1. count_vec v x = card {i. v $ i = x \<and> i < dim_vec v}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
count_vec v x = size {#a \<in># mset_set {..<dim_vec v}. x = v $ a#}
[PROOF STEP]
have "count_vec v x = card {a \<in> {..<dim_vec v} . x = (v $ a)}"
[PROOF STATE]
proof (prove)
using this:
count_vec v x = size {#a \<in># mset_set {..<dim_vec v}. x = v $ a#}

goal (1 subgoal):
 1. count_vec v x = card {a \<in> {..<dim_vec v}. x = v $ a}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count_vec v x = card {a \<in> {..<dim_vec v}. x = v $ a}

goal (1 subgoal):
 1. count_vec v x = card {i. v $ i = x \<and> i < dim_vec v}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
count_vec v x = card {a \<in> {..<dim_vec v}. x = v $ a}

goal (1 subgoal):
 1. count_vec v x = card {i. v $ i = x \<and> i < dim_vec v}
[PROOF STEP]
by (smt (verit) Collect_cong lessThan_iff)
[PROOF STATE]
proof (state)
this:
count_vec v x = card {i. v $ i = x \<and> i < dim_vec v}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma adjoint_minus:
  fixes A B :: "'a::conjugatable_field mat"
  assumes "A \<in> carrier_mat n m" "B \<in> carrier_mat n m"
  shows "adjoint (A - B) = adjoint A - adjoint B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint (A - B) = adjoint A - adjoint B
[PROOF STEP]
apply (rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (adjoint A - adjoint B); j < dim_col (adjoint A - adjoint B)\<rbrakk> \<Longrightarrow> adjoint (A - B) $$ (i, j) = (adjoint A - adjoint B) $$ (i, j)
 2. dim_row (adjoint (A - B)) = dim_row (adjoint A - adjoint B)
 3. dim_col (adjoint (A - B)) = dim_col (adjoint A - adjoint B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n m
B \<in> carrier_mat n m

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (adjoint A - adjoint B); j < dim_col (adjoint A - adjoint B)\<rbrakk> \<Longrightarrow> adjoint (A - B) $$ (i, j) = (adjoint A - adjoint B) $$ (i, j)
 2. dim_row (adjoint (A - B)) = dim_row (adjoint A - adjoint B)
 3. dim_col (adjoint (A - B)) = dim_col (adjoint A - adjoint B)
[PROOF STEP]
apply(auto simp add: adjoint_eval)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < m; j < n; A \<in> carrier_mat n m; B \<in> carrier_mat n m\<rbrakk> \<Longrightarrow> conjugate (A $$ (j, i) - B $$ (j, i)) = conjugate (A $$ (j, i)) - conjugate (B $$ (j, i))
[PROOF STEP]
by (metis add_uminus_conv_diff conjugate_dist_add conjugate_neg)


[STATEMENT]
lemma cstrong_operator_topology_basis:
  fixes f::"('a::complex_normed_vector \<Rightarrow>\<^sub>C\<^sub>L'b::complex_normed_vector)" and U::"'i \<Rightarrow> 'b set" and x::"'i \<Rightarrow> 'a"
  assumes "finite I" "\<And>i. i \<in> I \<Longrightarrow> open (U i)"
  shows "openin cstrong_operator_topology {f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin cstrong_operator_topology {f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. openin cstrong_operator_topology {f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i}
[PROOF STEP]
have "open {g::('a\<Rightarrow>'b). \<forall>i\<in>I. g (x i) \<in> U i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {g. \<forall>i\<in>I. g (x i) \<in> U i}
[PROOF STEP]
by (rule product_topology_basis'[OF assms])
[PROOF STATE]
proof (state)
this:
open {g. \<forall>i\<in>I. g (x i) \<in> U i}

goal (1 subgoal):
 1. openin cstrong_operator_topology {f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
open {g. \<forall>i\<in>I. g (x i) \<in> U i}

goal (1 subgoal):
 1. openin cstrong_operator_topology {f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i}
[PROOF STEP]
have "{f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i}
                = cblinfun_apply-`{g::('a\<Rightarrow>'b). \<forall>i\<in>I. g (x i) \<in> U i} \<inter> UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i} = cblinfun_apply -` {g. \<forall>i\<in>I. g (x i) \<in> U i} \<inter> UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i} = cblinfun_apply -` {g. \<forall>i\<in>I. g (x i) \<in> U i} \<inter> UNIV

goal (1 subgoal):
 1. openin cstrong_operator_topology {f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
open {g. \<forall>i\<in>I. g (x i) \<in> U i}
{f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i} = cblinfun_apply -` {g. \<forall>i\<in>I. g (x i) \<in> U i} \<inter> UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
open {g. \<forall>i\<in>I. g (x i) \<in> U i}
{f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i} = cblinfun_apply -` {g. \<forall>i\<in>I. g (x i) \<in> U i} \<inter> UNIV

goal (1 subgoal):
 1. openin cstrong_operator_topology {f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i}
[PROOF STEP]
unfolding cstrong_operator_topology_def
[PROOF STATE]
proof (prove)
using this:
open {g. \<forall>i\<in>I. g (x i) \<in> U i}
{f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i} = cblinfun_apply -` {g. \<forall>i\<in>I. g (x i) \<in> U i} \<inter> UNIV

goal (1 subgoal):
 1. openin (pullback_topology UNIV cblinfun_apply euclidean) {f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i}
[PROOF STEP]
by (subst openin_pullback_topology) auto
[PROOF STATE]
proof (state)
this:
openin cstrong_operator_topology {f. \<forall>i\<in>I. cblinfun_apply f (x i) \<in> U i}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma min_height_acomplete: assumes "acomplete t"
shows "min_height t = nat(floor(log 2 (size1 t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
 2. \<not> ?P \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
[PROOF STEP]
assume *: "complete t"
[PROOF STATE]
proof (state)
this:
Tree.complete t

goal (2 subgoals):
 1. ?P \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
 2. \<not> ?P \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
[PROOF STEP]
hence "size1 t = 2 ^ min_height t"
[PROOF STATE]
proof (prove)
using this:
Tree.complete t

goal (1 subgoal):
 1. size1 t = 2 ^ min_height t
[PROOF STEP]
by (simp add: complete_iff_height size1_if_complete)
[PROOF STATE]
proof (state)
this:
size1 t = 2 ^ min_height t

goal (2 subgoals):
 1. ?P \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
 2. \<not> ?P \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
[PROOF STEP]
from log2_of_power_eq[OF this]
[PROOF STATE]
proof (chain)
picking this:
real (min_height t) = log 2 (real (size1 t))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (min_height t) = log 2 (real (size1 t))

goal (1 subgoal):
 1. min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>

goal (1 subgoal):
 1. \<not> Tree.complete t \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Tree.complete t \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
[PROOF STEP]
assume *: "\<not> complete t"
[PROOF STATE]
proof (state)
this:
\<not> Tree.complete t

goal (1 subgoal):
 1. \<not> Tree.complete t \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
[PROOF STEP]
hence "height t = min_height t + 1"
[PROOF STATE]
proof (prove)
using this:
\<not> Tree.complete t

goal (1 subgoal):
 1. height t = min_height t + 1
[PROOF STEP]
using assms min_height_le_height[of t]
[PROOF STATE]
proof (prove)
using this:
\<not> Tree.complete t
acomplete t
min_height t \<le> height t

goal (1 subgoal):
 1. height t = min_height t + 1
[PROOF STEP]
by(auto simp: acomplete_def complete_iff_height)
[PROOF STATE]
proof (state)
this:
height t = min_height t + 1

goal (1 subgoal):
 1. \<not> Tree.complete t \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
[PROOF STEP]
hence "size1 t < 2 ^ (min_height t + 1)"
[PROOF STATE]
proof (prove)
using this:
height t = min_height t + 1

goal (1 subgoal):
 1. size1 t < 2 ^ (min_height t + 1)
[PROOF STEP]
by (metis * size1_height_if_incomplete)
[PROOF STATE]
proof (state)
this:
size1 t < 2 ^ (min_height t + 1)

goal (1 subgoal):
 1. \<not> Tree.complete t \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
[PROOF STEP]
from floor_log_nat_eq_if[OF min_height_size1 this]
[PROOF STATE]
proof (chain)
picking this:
2 \<le> 2 \<Longrightarrow> \<lfloor>log (real 2) (real (size1 t))\<rfloor> = int (min_height t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 \<le> 2 \<Longrightarrow> \<lfloor>log (real 2) (real (size1 t))\<rfloor> = int (min_height t)

goal (1 subgoal):
 1. min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
min_height t = nat \<lfloor>log 2 (real (size1 t))\<rfloor>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_matrix_le_op_norm: "\<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> \<parallel>A\<parallel>\<^sub>o\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<le> \<parallel>A\<parallel>\<^sub>o\<^sub>p
[PROOF STEP]
apply(unfold onorm_def, rule cSup_upper[OF _ onorm_set_proptys(2)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<in> range (\<lambda>x. \<parallel>A *v x\<parallel> / \<parallel>x\<parallel>)
[PROOF STEP]
unfolding image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>x\<parallel> = 1 \<Longrightarrow> \<parallel>A *v x\<parallel> \<in> {y. \<exists>x\<in>UNIV. y = \<parallel>A *v x\<parallel> / \<parallel>x\<parallel>}
[PROOF STEP]
by (clarsimp, rule_tac x=x in exI) simp


[STATEMENT]
lemma minus_image_eq_vimage:
  fixes A :: "'a::ab_group_add set"
  shows "(\<lambda>x. - x) ` A = (\<lambda>x. - x) -` A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uminus ` A = uminus -` A
[PROOF STEP]
by (auto intro!: image_eqI [where f="\<lambda>x. - x"])


[STATEMENT]
lemma sum_norm_allsubsets_bound_cart:
  fixes f:: "'a \<Rightarrow> real ^'n"
  assumes fP: "finite P" and fPs: "\<And>Q. Q \<subseteq> P \<Longrightarrow> norm (sum f Q) \<le> e"
  shows "sum (\<lambda>x. norm (f x)) P \<le> 2 * real CARD('n) *  e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real CARD('n) * e
[PROOF STEP]
using sum_norm_allsubsets_bound[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>Q. Q \<subseteq> P \<Longrightarrow> Q \<subseteq> P) \<Longrightarrow> (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM((real, 'n) vec) * e

goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real CARD('n) * e
[PROOF STEP]
by simp


[STATEMENT]
lemma matrix_sum_add_distrib:
  shows "(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> (\<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d)
    \<Longrightarrow> matrix_sum d (\<lambda>k. (f k) + (g k)) n = matrix_sum d f n + matrix_sum d g n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>k. k < 0 \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < 0 \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) 0 = matrix_sum d f 0 + matrix_sum d g 0
 2. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) (Suc n) = matrix_sum d f (Suc n) + matrix_sum d g (Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
?k < 0 \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < 0 \<Longrightarrow> g ?k \<in> carrier_mat d d

goal (2 subgoals):
 1. \<lbrakk>\<And>k. k < 0 \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < 0 \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) 0 = matrix_sum d f 0 + matrix_sum d g 0
 2. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) (Suc n) = matrix_sum d f (Suc n) + matrix_sum d g (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k < 0 \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < 0 \<Longrightarrow> g ?k \<in> carrier_mat d d
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?k < 0 \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < 0 \<Longrightarrow> g ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. f k + g k) 0 = matrix_sum d f 0 + matrix_sum d g 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. f k + g k) 0 = matrix_sum d f 0 + matrix_sum d g 0

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) (Suc n) = matrix_sum d f (Suc n) + matrix_sum d g (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) (Suc n) = matrix_sum d f (Suc n) + matrix_sum d g (Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n
?k < Suc n \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> g ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) (Suc n) = matrix_sum d f (Suc n) + matrix_sum d g (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n
?k < Suc n \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> g ?k \<in> carrier_mat d d
[PROOF STEP]
have dfn: "f n \<in> carrier_mat d d" and dgn: "g n \<in> carrier_mat d d"
    and dfk: "k < n \<Longrightarrow> f k \<in> carrier_mat d d" and dgk: "k < n \<Longrightarrow> g k \<in> carrier_mat d d"
    and eq: "matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n" for k
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n
?k < Suc n \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> g ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. (f n \<in> carrier_mat d d &&& g n \<in> carrier_mat d d) &&& (k < n \<Longrightarrow> f k \<in> carrier_mat d d) &&& (k < n \<Longrightarrow> g k \<in> carrier_mat d d) &&& matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f n \<in> carrier_mat d d
g n \<in> carrier_mat d d
?k < n \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < n \<Longrightarrow> g ?k \<in> carrier_mat d d
matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) (Suc n) = matrix_sum d f (Suc n) + matrix_sum d g (Suc n)
[PROOF STEP]
have dsf: "matrix_sum d f n \<in> carrier_mat d d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d f n \<in> carrier_mat d d
[PROOF STEP]
using matrix_sum_dim dfk
[PROOF STATE]
proof (prove)
using this:
(\<And>k. k < ?n \<Longrightarrow> ?f k \<in> carrier_mat ?d ?d) \<Longrightarrow> matrix_sum ?d ?f ?n \<in> carrier_mat ?d ?d
?k < n \<Longrightarrow> f ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. matrix_sum d f n \<in> carrier_mat d d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d f n \<in> carrier_mat d d

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) (Suc n) = matrix_sum d f (Suc n) + matrix_sum d g (Suc n)
[PROOF STEP]
have dsg: "matrix_sum d g n \<in> carrier_mat d d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d g n \<in> carrier_mat d d
[PROOF STEP]
using matrix_sum_dim dgk
[PROOF STATE]
proof (prove)
using this:
(\<And>k. k < ?n \<Longrightarrow> ?f k \<in> carrier_mat ?d ?d) \<Longrightarrow> matrix_sum ?d ?f ?n \<in> carrier_mat ?d ?d
?k < n \<Longrightarrow> g ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. matrix_sum d g n \<in> carrier_mat d d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d g n \<in> carrier_mat d d

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) n = matrix_sum d f n + matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. f k + g k) (Suc n) = matrix_sum d f (Suc n) + matrix_sum d g (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. f k + g k) (Suc n) = matrix_sum d f (Suc n) + matrix_sum d g (Suc n)
[PROOF STEP]
unfolding matrix_sum.simps eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f n + g n + (matrix_sum d f n + matrix_sum d g n) = f n + matrix_sum d f n + (g n + matrix_sum d g n)
[PROOF STEP]
using dfn dgn dsf dsg
[PROOF STATE]
proof (prove)
using this:
f n \<in> carrier_mat d d
g n \<in> carrier_mat d d
matrix_sum d f n \<in> carrier_mat d d
matrix_sum d g n \<in> carrier_mat d d

goal (1 subgoal):
 1. f n + g n + (matrix_sum d f n + matrix_sum d g n) = f n + matrix_sum d f n + (g n + matrix_sum d g n)
[PROOF STEP]
by (mat_assoc d)
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. f k + g k) (Suc n) = matrix_sum d f (Suc n) + matrix_sum d g (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l7: "fact n = \<Prod> {0 <.. int n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact n = \<Prod>{0<..int n}
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fact 0 = \<Prod>{0<..int 0}
 2. \<And>n. fact n = \<Prod>{0<..int n} \<Longrightarrow> fact (Suc n) = \<Prod>{0<..int (Suc n)}
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
fact n = \<Prod>{0<..int n}

goal (2 subgoals):
 1. fact 0 = \<Prod>{0<..int 0}
 2. \<And>n. fact n = \<Prod>{0<..int n} \<Longrightarrow> fact (Suc n) = \<Prod>{0<..int (Suc n)}
[PROOF STEP]
have "int (Suc n) = int n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (Suc n) = int n + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (Suc n) = int n + 1

goal (2 subgoals):
 1. fact 0 = \<Prod>{0<..int 0}
 2. \<And>n. fact n = \<Prod>{0<..int n} \<Longrightarrow> fact (Suc n) = \<Prod>{0<..int (Suc n)}
[PROOF STEP]
hence "insert (int (Suc n)) {0<..int n} = {0<..int (Suc n)}"
[PROOF STATE]
proof (prove)
using this:
int (Suc n) = int n + 1

goal (1 subgoal):
 1. insert (int (Suc n)) {0<..int n} = {0<..int (Suc n)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert (int (Suc n)) {0<..int n} = {0<..int (Suc n)}

goal (2 subgoals):
 1. fact 0 = \<Prod>{0<..int 0}
 2. \<And>n. fact n = \<Prod>{0<..int n} \<Longrightarrow> fact (Suc n) = \<Prod>{0<..int (Suc n)}
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
insert (int (Suc n)) {0<..int n} = {0<..int (Suc n)}

goal (1 subgoal):
 1. fact (Suc n) = \<Prod>{0<..int (Suc n)}
[PROOF STEP]
using prod.insert[of "{0<..int n}" "int (Suc n)" "\<lambda>x. x"] Suc fact_Suc
[PROOF STATE]
proof (prove)
using this:
insert (int (Suc n)) {0<..int n} = {0<..int (Suc n)}
\<lbrakk>finite {0<..int n}; int (Suc n) \<notin> {0<..int n}\<rbrakk> \<Longrightarrow> \<Prod>(insert (int (Suc n)) {0<..int n}) = int (Suc n) * \<Prod>{0<..int n}
fact n = \<Prod>{0<..int n}
fact (Suc ?n) = of_nat (Suc ?n) * fact ?n

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

goal (1 subgoal):
 1. fact 0 = \<Prod>{0<..int 0}
[PROOF STEP]
qed simp


[STATEMENT]
lemma tendsto_ln_powr_over_ln_powr:
  assumes "(a::real) > 0" "c > 0"
  shows   "((\<lambda>x. ln (a*x) powr d / ln (c*x) powr d) \<longlongrightarrow> 1) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. ln (a * x) powr d / ln (c * x) powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. ln (a * x) powr d / ln (c * x) powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
have "eventually (\<lambda>x. ln (a*x) powr d / ln (c*x) powr d = (ln (a*x) / ln (c*x)) powr d) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. ln (a * x) powr d / ln (c * x) powr d = (ln (a * x) / ln (c * x)) powr d
[PROOF STEP]
using assms eventually_gt_at_top[of "max (inverse a) (inverse c)"]
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < c
eventually ((<) (max (inverse a) (inverse c))) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. ln (a * x) powr d / ln (c * x) powr d = (ln (a * x) / ln (c * x)) powr d
[PROOF STEP]
by (auto elim!: eventually_mono simp: powr_divide field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. ln (a * x) powr d / ln (c * x) powr d = (ln (a * x) / ln (c * x)) powr d

goal (1 subgoal):
 1. ((\<lambda>x. ln (a * x) powr d / ln (c * x) powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. ln (a * x) powr d / ln (c * x) powr d = (ln (a * x) / ln (c * x)) powr d

goal (1 subgoal):
 1. ((\<lambda>x. ln (a * x) powr d / ln (c * x) powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
have "((\<lambda>x. (ln (a*x) / ln (c*x)) powr d) \<longlongrightarrow> 1) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (ln (a * x) / ln (c * x)) powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < c

goal (1 subgoal):
 1. ((\<lambda>x. (ln (a * x) / ln (c * x)) powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
by (intro tendsto_eq_rhs[OF tendsto_powr[OF tendsto_ln_over_ln tendsto_const]]) simp_all
[PROOF STATE]
proof (state)
this:
((\<lambda>x. (ln (a * x) / ln (c * x)) powr d) \<longlongrightarrow> 1) at_top

goal (1 subgoal):
 1. ((\<lambda>x. ln (a * x) powr d / ln (c * x) powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. ln (a * x) powr d / ln (c * x) powr d = (ln (a * x) / ln (c * x)) powr d
((\<lambda>x. (ln (a * x) / ln (c * x)) powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. ln (a * x) powr d / ln (c * x) powr d = (ln (a * x) / ln (c * x)) powr d
((\<lambda>x. (ln (a * x) / ln (c * x)) powr d) \<longlongrightarrow> 1) at_top

goal (1 subgoal):
 1. ((\<lambda>x. ln (a * x) powr d / ln (c * x) powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
by (subst tendsto_cong)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. ln (a * x) powr d / ln (c * x) powr d) \<longlongrightarrow> 1) at_top

goal:
No subgoals!
[PROOF STEP]
qed