[STATEMENT]
lemma nat_less_power_trans:
  fixes n :: nat
  assumes nv: "n < 2 ^ (m - k)"
  and     kv: "k \<le> m"
  shows "2 ^ k * n < 2 ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * n < 2 ^ m
[PROOF STEP]
proof (rule order_less_le_trans)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 2 ^ k * n < ?y
 2. ?y \<le> 2 ^ m
[PROOF STEP]
show "2 ^ k * n < 2 ^ k * 2 ^ (m - k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * n < 2 ^ k * 2 ^ (m - k)
[PROOF STEP]
by (rule mult_less_mono2 [OF nv zero_less_power]) simp
[PROOF STATE]
proof (state)
this:
2 ^ k * n < 2 ^ k * 2 ^ (m - k)

goal (1 subgoal):
 1. 2 ^ k * 2 ^ (m - k) \<le> 2 ^ m
[PROOF STEP]
show "(2::nat) ^ k * 2 ^ (m - k) \<le> 2 ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * 2 ^ (m - k) \<le> 2 ^ m
[PROOF STEP]
using nv kv
[PROOF STATE]
proof (prove)
using this:
n < 2 ^ (m - k)
k \<le> m

goal (1 subgoal):
 1. 2 ^ k * 2 ^ (m - k) \<le> 2 ^ m
[PROOF STEP]
by (subst power_add [symmetric]) simp
[PROOF STATE]
proof (state)
this:
2 ^ k * 2 ^ (m - k) \<le> 2 ^ m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_upper_bound_power_even_nonpos:
  assumes "even n" "eventually (\<lambda>x. u x \<le> (0::real)) at_top"
          "eventually (\<lambda>x. l x \<le> f x) at_top" "eventually (\<lambda>x. f x \<le> u x) at_top"
  shows   "eventually (\<lambda>x. f x ^ n \<le> l x ^ n) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x ^ n \<le> l x ^ n
[PROOF STEP]
using assms(2-)
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. u x \<le> 0
\<forall>\<^sub>F x in at_top. l x \<le> f x
\<forall>\<^sub>F x in at_top. f x \<le> u x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x ^ n \<le> l x ^ n
[PROOF STEP]
by eventually_elim (rule power_mono_even, auto simp: assms(1))


[STATEMENT]
theorem Fiber_equality:
  "\<lbrakk> a \<in> S; b \<in> S \<rbrakk> \<Longrightarrow> Class a = Class b \<longleftrightarrow> \<alpha> a = \<alpha> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> (Class a = Class b) = (\<alpha> a = \<alpha> b)
[PROOF STEP]
unfolding Class_equivalence
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> ((a, b) \<in> E(\<alpha>)) = (\<alpha> a = \<alpha> b)
[PROOF STEP]
unfolding Fiber_Relation_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> ((a, b) \<in> {(x, y). x \<in> S \<and> y \<in> S \<and> \<alpha> x = \<alpha> y}) = (\<alpha> a = \<alpha> b)
[PROOF STEP]
by simp


[STATEMENT]
lemma ln_272_gt_1: "ln (272/100) > (1::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < ln (272 / 100)
[PROOF STEP]
by (metis e_less_272 exp_less_cancel_iff exp_ln_iff less_trans ln_exp)


[STATEMENT]
lemma ld_ld_less2: assumes "x \<ge> 2" "y \<ge> 2"
  shows "1 + log 2 x + log 2 y \<le> 2 * log 2 (x + y - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + log 2 x + log 2 y \<le> 2 * log 2 (x + y - 1)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 + log 2 x + log 2 y \<le> 2 * log 2 (x + y - 1)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
2 \<le> x
2 \<le> y
[PROOF STEP]
have "2*x \<le> x*x" "2*y \<le> y*y"
[PROOF STATE]
proof (prove)
using this:
2 \<le> x
2 \<le> y

goal (1 subgoal):
 1. 2 * x \<le> x * x &&& 2 * y \<le> y * y
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
2 * x \<le> x * x
2 * y \<le> y * y

goal (1 subgoal):
 1. 1 + log 2 x + log 2 y \<le> 2 * log 2 (x + y - 1)
[PROOF STEP]
hence 1: "2 * x * y \<le> (x + y - 1)^2"
[PROOF STATE]
proof (prove)
using this:
2 * x \<le> x * x
2 * y \<le> y * y

goal (1 subgoal):
 1. 2 * x * y \<le> (x + y - 1)\<^sup>2
[PROOF STEP]
by(simp add: numeral_eq_Suc algebra_simps)
[PROOF STATE]
proof (state)
this:
2 * x * y \<le> (x + y - 1)\<^sup>2

goal (1 subgoal):
 1. 1 + log 2 x + log 2 y \<le> 2 * log 2 (x + y - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + log 2 x + log 2 y \<le> 2 * log 2 (x + y - 1)
[PROOF STEP]
apply(rule powr_le_cancel_iff[of 2, THEN iffD1])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 1 < 2
 2. 2 powr (1 + log 2 x + log 2 y) \<le> 2 powr (2 * log 2 (x + y - 1))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 powr (1 + log 2 x + log 2 y) \<le> 2 powr (2 * log 2 (x + y - 1))
[PROOF STEP]
using assms 1
[PROOF STATE]
proof (prove)
using this:
2 \<le> x
2 \<le> y
2 * x * y \<le> (x + y - 1)\<^sup>2

goal (1 subgoal):
 1. 2 powr (1 + log 2 x + log 2 y) \<le> 2 powr (2 * log 2 (x + y - 1))
[PROOF STEP]
by(simp add: powr_add log_powr[symmetric] powr_numeral)
[PROOF STATE]
proof (state)
this:
1 + log 2 x + log 2 y \<le> 2 * log 2 (x + y - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fact_prod_rev: "fact n = of_nat (\<Prod>i = 0..<n. n - i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact n = of_nat (prod ((-) n) {0..<n})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fact n = of_nat (prod ((-) n) {0..<n})
[PROOF STEP]
have "prod Suc {0..<n} = \<Prod>{1..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod Suc {0..<n} = \<Prod>{1..n}
[PROOF STEP]
by (simp add: atLeast0LessThan prod.atLeast1_atMost_eq)
[PROOF STATE]
proof (state)
this:
prod Suc {0..<n} = \<Prod>{1..n}

goal (1 subgoal):
 1. fact n = of_nat (prod ((-) n) {0..<n})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
prod Suc {0..<n} = \<Prod>{1..n}
[PROOF STEP]
have "prod Suc {0..<n} = prod ((-) (n + 1)) {1..n}"
[PROOF STATE]
proof (prove)
using this:
prod Suc {0..<n} = \<Prod>{1..n}

goal (1 subgoal):
 1. prod Suc {0..<n} = prod ((-) (n + 1)) {1..n}
[PROOF STEP]
using prod.atLeastAtMost_rev [of "\<lambda>i. i" 1 n]
[PROOF STATE]
proof (prove)
using this:
prod Suc {0..<n} = \<Prod>{1..n}
\<Prod>{1..n} = prod ((-) (n + 1)) {1..n}

goal (1 subgoal):
 1. prod Suc {0..<n} = prod ((-) (n + 1)) {1..n}
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
prod Suc {0..<n} = prod ((-) (n + 1)) {1..n}

goal (1 subgoal):
 1. fact n = of_nat (prod ((-) n) {0..<n})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
prod Suc {0..<n} = prod ((-) (n + 1)) {1..n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prod Suc {0..<n} = prod ((-) (n + 1)) {1..n}

goal (1 subgoal):
 1. fact n = of_nat (prod ((-) n) {0..<n})
[PROOF STEP]
unfolding fact_prod_Suc
[PROOF STATE]
proof (prove)
using this:
prod Suc {0..<n} = prod ((-) (n + 1)) {1..n}

goal (1 subgoal):
 1. of_nat (prod Suc {0..<n}) = of_nat (prod ((-) n) {0..<n})
[PROOF STEP]
by (simp add: atLeast0LessThan prod.atLeast1_atMost_eq)
[PROOF STATE]
proof (state)
this:
fact n = of_nat (prod ((-) n) {0..<n})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_boundary_of_convex_hull:
    fixes S :: "'a::euclidean_space set"
    assumes "\<not> affine_dependent S"
      shows "(convex hull S) - rel_interior(convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
have "finite S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S
[PROOF STEP]
by (metis assms aff_independent_finite)
[PROOF STATE]
proof (state)
this:
finite S

goal (1 subgoal):
 1. convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite S
[PROOF STEP]
consider "card S = 0" | "card S = 1" | "2 \<le> card S"
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. \<lbrakk>card S = 0 \<Longrightarrow> thesis; card S = 1 \<Longrightarrow> thesis; 2 \<le> card S \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
\<lbrakk>card S = 0 \<Longrightarrow> ?thesis; card S = 1 \<Longrightarrow> ?thesis; 2 \<le> card S \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>card S = 0 \<Longrightarrow> ?thesis; card S = 1 \<Longrightarrow> ?thesis; 2 \<le> card S \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>card S = 0 \<Longrightarrow> ?thesis; card S = 1 \<Longrightarrow> ?thesis; 2 \<le> card S \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. card S = 0 \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
 2. card S = 1 \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
 3. 2 \<le> card S \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
card S = 0

goal (3 subgoals):
 1. card S = 0 \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
 2. card S = 1 \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
 3. 2 \<le> card S \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card S = 0
[PROOF STEP]
have "S = {}"
[PROOF STATE]
proof (prove)
using this:
card S = 0

goal (1 subgoal):
 1. S = {}
[PROOF STEP]
by (simp add: \<open>finite S\<close>)
[PROOF STATE]
proof (state)
this:
S = {}

goal (3 subgoals):
 1. card S = 0 \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
 2. card S = 1 \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
 3. 2 \<le> card S \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S = {}

goal (1 subgoal):
 1. convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))

goal (2 subgoals):
 1. card S = 1 \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
 2. 2 \<le> card S \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card S = 1 \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
 2. 2 \<le> card S \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
card S = 1

goal (2 subgoals):
 1. card S = 1 \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
 2. 2 \<le> card S \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
by (auto intro: card_1_singletonE [OF \<open>card S = 1\<close>])
[PROOF STATE]
proof (state)
this:
convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))

goal (1 subgoal):
 1. 2 \<le> card S \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 \<le> card S \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
case 3
[PROOF STATE]
proof (state)
this:
2 \<le> card S

goal (1 subgoal):
 1. 2 \<le> card S \<Longrightarrow> convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<not> affine_dependent S
2 \<le> card S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> affine_dependent S
2 \<le> card S

goal (1 subgoal):
 1. convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))
[PROOF STEP]
by (auto simp: polyhedron_convex_hull rel_boundary_of_polyhedron facet_of_convex_hull_affine_independent_alt \<open>finite S\<close>)
[PROOF STATE]
proof (state)
this:
convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
convex hull S - rel_interior (convex hull S) = (\<Union>a\<in>S. convex hull (S - {a}))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma emeasure_cball_aux_integral:
  "(\<integral>\<^sup>+x. indicator {-1..1} x * sqrt (1 - x\<^sup>2) ^ n \<partial>lborel) =
      ennreal (Beta (1 / 2) (real n / 2 + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
have "((\<lambda>t. t powr (-1 / 2) * (1 - t) powr (real n / 2)) has_integral
          Beta (1 / 2) (real n / 2 + 1)) {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. t powr (- 1 / 2) * (1 - t) powr (real n / 2)) has_integral Beta (1 / 2) (real n / 2 + 1)) {0..1}
[PROOF STEP]
using has_integral_Beta_real[of "1/2" "n / 2 + 1"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 1 / 2; 0 < real n / 2 + 1\<rbrakk> \<Longrightarrow> ((\<lambda>t. t powr (1 / 2 - 1) * (1 - t) powr (real n / 2 + 1 - 1)) has_integral Beta (1 / 2) (real n / 2 + 1)) {0..1}

goal (1 subgoal):
 1. ((\<lambda>t. t powr (- 1 / 2) * (1 - t) powr (real n / 2)) has_integral Beta (1 / 2) (real n / 2 + 1)) {0..1}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>t. t powr (- 1 / 2) * (1 - t) powr (real n / 2)) has_integral Beta (1 / 2) (real n / 2 + 1)) {0..1}

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
from nn_integral_has_integral_lebesgue[OF _ this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. 0 \<le> x powr (- 1 / 2) * (1 - x) powr (real n / 2)) \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (indicat_real {0..1} x * (x powr (- 1 / 2) * (1 - x) powr (real n / 2))) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
have
     "ennreal (Beta (1 / 2) (real n / 2 + 1)) =
        nn_integral lborel (\<lambda>t. ennreal (t powr (-1 / 2) * (1 - t) powr (real n / 2) *
                                indicator {0^2..1^2} t))"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. 0 \<le> x powr (- 1 / 2) * (1 - x) powr (real n / 2)) \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (indicat_real {0..1} x * (x powr (- 1 / 2) * (1 - x) powr (real n / 2))) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))

goal (1 subgoal):
 1. ennreal (Beta (1 / 2) (real n / 2 + 1)) = \<integral>\<^sup>+ t. ennreal (t powr (- 1 / 2) * (1 - t) powr (real n / 2) * indicat_real {0\<^sup>2..1\<^sup>2} t) \<partial>lborel
[PROOF STEP]
by (simp add: mult_ac ennreal_mult' ennreal_indicator)
[PROOF STATE]
proof (state)
this:
ennreal (Beta (1 / 2) (real n / 2 + 1)) = \<integral>\<^sup>+ t. ennreal (t powr (- 1 / 2) * (1 - t) powr (real n / 2) * indicat_real {0\<^sup>2..1\<^sup>2} t) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (Beta (1 / 2) (real n / 2 + 1)) = \<integral>\<^sup>+ t. ennreal (t powr (- 1 / 2) * (1 - t) powr (real n / 2) * indicat_real {0\<^sup>2..1\<^sup>2} t) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ x. ennreal (x\<^sup>2 powr - (1 / 2) * (1 - x\<^sup>2) powr (real n / 2) * (2 * x) *
                          indicator {0..1} x) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ t. ennreal (t powr (- 1 / 2) * (1 - t) powr (real n / 2) * indicat_real {0\<^sup>2..1\<^sup>2} t) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (x\<^sup>2 powr - (1 / 2) * (1 - x\<^sup>2) powr (real n / 2) * (2 * x) * indicat_real {0..1} x) \<partial>lborel
[PROOF STEP]
by (subst nn_integral_substitution[where g = "\<lambda>x. x ^ 2" and g' = "\<lambda>x. 2 * x"])
       (auto intro!: derivative_eq_intros continuous_intros simp: set_borel_measurable_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. ennreal (t powr (- 1 / 2) * (1 - t) powr (real n / 2) * indicat_real {0\<^sup>2..1\<^sup>2} t) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (x\<^sup>2 powr - (1 / 2) * (1 - x\<^sup>2) powr (real n / 2) * (2 * x) * indicat_real {0..1} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ t. ennreal (t powr (- 1 / 2) * (1 - t) powr (real n / 2) * indicat_real {0\<^sup>2..1\<^sup>2} t) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (x\<^sup>2 powr - (1 / 2) * (1 - x\<^sup>2) powr (real n / 2) * (2 * x) * indicat_real {0..1} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ x. 2 * ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicator {0..1} x) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (x\<^sup>2 powr - (1 / 2) * (1 - x\<^sup>2) powr (real n / 2) * (2 * x) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. 2 * ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong_AE AE_I[of _ _ "{0}"])
       (auto simp: indicator_def powr_minus powr_half_sqrt field_split_simps ennreal_mult')
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (x\<^sup>2 powr - (1 / 2) * (1 - x\<^sup>2) powr (real n / 2) * (2 * x) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. 2 * ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (x\<^sup>2 powr - (1 / 2) * (1 - x\<^sup>2) powr (real n / 2) * (2 * x) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. 2 * ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicator {0..1} x) \<partial>lborel) +
                    (\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicator {0..1} x) \<partial>lborel)"
    (is "_ = ?I + _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. 2 * ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel
[PROOF STEP]
by (simp add: mult_2 nn_integral_add)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. 2 * ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. 2 * ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
have "?I = (\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicator {-1..0} x) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..0} x) \<partial>lborel
[PROOF STEP]
by (subst nn_integral_real_affine[of _ "-1" 0])
       (auto simp: indicator_def intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..0} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
hence "?I + ?I = \<dots> + ?I"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..0} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..0} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..0} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..0} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) *
                    (indicator {-1..0} x + indicator{0..1} x)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..0} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * (indicat_real {- 1..0} x + indicat_real {0..1} x)) \<partial>lborel
[PROOF STEP]
by (subst nn_integral_add [symmetric]) (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..0} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * (indicat_real {- 1..0} x + indicat_real {0..1} x)) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..0} x) \<partial>lborel + \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {0..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * (indicat_real {- 1..0} x + indicat_real {0..1} x)) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicator {-1..1} x) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * (indicat_real {- 1..0} x + indicat_real {0..1} x)) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..1} x) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong_AE AE_I[of _ _ "{0}"]) (auto simp: indicator_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * (indicat_real {- 1..0} x + indicat_real {0..1} x)) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..1} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * (indicat_real {- 1..0} x + indicat_real {0..1} x)) \<partial>lborel = \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..1} x) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ x. ennreal (indicator {-1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong_AE AE_I[of _ _ "{1, -1}"])
       (auto simp: powr_half_sqrt [symmetric] indicator_def abs_square_le_1
          abs_square_eq_1 powr_def exp_of_nat_mult [symmetric] emeasure_lborel_countable)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal ((1 - x\<^sup>2) powr (real n / 2) * indicat_real {- 1..1} x) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ennreal (Beta (1 / 2) (real n / 2 + 1)) = \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ennreal (Beta (1 / 2) (real n / 2 + 1)) = \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ n) \<partial>lborel = ennreal (Beta (1 / 2) (real n / 2 + 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_all_0_iff_0: "(\<forall>x. poly p x = 0) \<longleftrightarrow> p = 0"
  for p :: "'a::{ring_char_0,comm_ring_1,ring_no_zero_divisors} poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. poly p x = (0::'a)) = (p = 0)
[PROOF STEP]
by (auto simp add: poly_eq_poly_eq_iff [symmetric])


[STATEMENT]
lemma transpose_mat_plus: assumes wf: "mat nr nc m1" "mat nr nc m2"
  shows "transpose nr (mat_plusI pl m1 m2) = mat_plusI pl (transpose nr m1) (transpose nr m2)" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix_Legacy.transpose nr (mat_plusI pl m1 m2) = mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2)
[PROOF STEP]
proof (rule mat_eqI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (Matrix_Legacy.transpose nr (mat_plusI pl m1 m2))
 2. mat ?nr ?nc (mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2))
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> Matrix_Legacy.transpose nr (mat_plusI pl m1 m2) ! i ! j = mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2) ! i ! j
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (Matrix_Legacy.transpose nr (mat_plusI pl m1 m2))
 2. mat ?nr ?nc (mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2))
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> Matrix_Legacy.transpose nr (mat_plusI pl m1 m2) ! i ! j = mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2) ! i ! j
[PROOF STEP]
assume i: "i < nr" and j: "j < nc"
[PROOF STATE]
proof (state)
this:
i < nr
j < nc

goal (3 subgoals):
 1. mat ?nr ?nc (Matrix_Legacy.transpose nr (mat_plusI pl m1 m2))
 2. mat ?nr ?nc (mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2))
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> Matrix_Legacy.transpose nr (mat_plusI pl m1 m2) ! i ! j = mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2) ! i ! j
[PROOF STEP]
note [simp] = transpose_index[OF _ this] mat_plus_index[OF _ _ j i] mat_plus_index[OF _ _ this]
[PROOF STATE]
proof (state)
this:
mat nr nc ?m \<Longrightarrow> Matrix_Legacy.transpose nr ?m ! i ! j = ?m ! j ! i
\<lbrakk>mat nr nc ?m1.0; mat nr nc ?m2.0\<rbrakk> \<Longrightarrow> mat_plusI ?pl ?m1.0 ?m2.0 ! j ! i = ?pl (?m1.0 ! j ! i) (?m2.0 ! j ! i)
\<lbrakk>mat nc nr ?m1.0; mat nc nr ?m2.0\<rbrakk> \<Longrightarrow> mat_plusI ?pl ?m1.0 ?m2.0 ! i ! j = ?pl (?m1.0 ! i ! j) (?m2.0 ! i ! j)

goal (3 subgoals):
 1. mat ?nr ?nc (Matrix_Legacy.transpose nr (mat_plusI pl m1 m2))
 2. mat ?nr ?nc (mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2))
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> Matrix_Legacy.transpose nr (mat_plusI pl m1 m2) ! i ! j = mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2) ! i ! j
[PROOF STEP]
show "?l ! i ! j = ?r ! i ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix_Legacy.transpose nr (mat_plusI pl m1 m2) ! i ! j = mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2) ! i ! j
[PROOF STEP]
using wf
[PROOF STATE]
proof (prove)
using this:
mat nr nc m1
mat nr nc m2

goal (1 subgoal):
 1. Matrix_Legacy.transpose nr (mat_plusI pl m1 m2) ! i ! j = mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2) ! i ! j
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Matrix_Legacy.transpose nr (mat_plusI pl m1 m2) ! i ! j = mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2) ! i ! j

goal (2 subgoals):
 1. mat nc nr (Matrix_Legacy.transpose nr (mat_plusI pl m1 m2))
 2. mat nc nr (mat_plusI pl (Matrix_Legacy.transpose nr m1) (Matrix_Legacy.transpose nr m2))
[PROOF STEP]
qed (auto intro: wf)


[STATEMENT]
lemma list_sum_distrib_aux:
  shows "(\<Sum>:xs/(n :: 'a :: archimedean_field) + \<Sum>:xs) = (1 + (1/n)) * \<Sum>:xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list xs / n + sum_list xs = ((1::'a) + (1::'a) / n) * sum_list xs
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sum_list [] / n + sum_list [] = ((1::'a) + (1::'a) / n) * sum_list []
 2. \<And>a xs. sum_list xs / n + sum_list xs = ((1::'a) + (1::'a) / n) * sum_list xs \<Longrightarrow> sum_list (a # xs) / n + sum_list (a # xs) = ((1::'a) + (1::'a) / n) * sum_list (a # xs)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. sum_list [] / n + sum_list [] = ((1::'a) + (1::'a) / n) * sum_list []
 2. \<And>a xs. sum_list xs / n + sum_list xs = ((1::'a) + (1::'a) / n) * sum_list xs \<Longrightarrow> sum_list (a # xs) / n + sum_list (a # xs) = ((1::'a) + (1::'a) / n) * sum_list (a # xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list [] / n + sum_list [] = ((1::'a) + (1::'a) / n) * sum_list []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list [] / n + sum_list [] = ((1::'a) + (1::'a) / n) * sum_list []

goal (1 subgoal):
 1. \<And>a xs. sum_list xs / n + sum_list xs = ((1::'a) + (1::'a) / n) * sum_list xs \<Longrightarrow> sum_list (a # xs) / n + sum_list (a # xs) = ((1::'a) + (1::'a) / n) * sum_list (a # xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. sum_list xs / n + sum_list xs = ((1::'a) + (1::'a) / n) * sum_list xs \<Longrightarrow> sum_list (a # xs) / n + sum_list (a # xs) = ((1::'a) + (1::'a) / n) * sum_list (a # xs)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
sum_list xs / n + sum_list xs = ((1::'a) + (1::'a) / n) * sum_list xs

goal (1 subgoal):
 1. \<And>a xs. sum_list xs / n + sum_list xs = ((1::'a) + (1::'a) / n) * sum_list xs \<Longrightarrow> sum_list (a # xs) / n + sum_list (a # xs) = ((1::'a) + (1::'a) / n) * sum_list (a # xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
have
      "\<Sum>:(x#xs)/n = x/n + \<Sum>:xs/n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (x # xs) / n = x / n + sum_list xs / n
[PROOF STEP]
by (simp add: add_divide_distrib)
[PROOF STATE]
proof (state)
this:
sum_list (x # xs) / n = x / n + sum_list xs / n

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (x # xs) / n = x / n + sum_list xs / n

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
with Cons
[PROOF STATE]
proof (chain)
picking this:
sum_list xs / n + sum_list xs = ((1::'a) + (1::'a) / n) * sum_list xs
sum_list (x # xs) / n = x / n + sum_list xs / n
[PROOF STEP]
have
      "\<dots> = x/n + (1+1/n)*\<Sum>:xs - \<Sum>:xs"
[PROOF STATE]
proof (prove)
using this:
sum_list xs / n + sum_list xs = ((1::'a) + (1::'a) / n) * sum_list xs
sum_list (x # xs) / n = x / n + sum_list xs / n

goal (1 subgoal):
 1. x / n + sum_list xs / n = x / n + ((1::'a) + (1::'a) / n) * sum_list xs - sum_list xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x / n + sum_list xs / n = x / n + ((1::'a) + (1::'a) / n) * sum_list xs - sum_list xs

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_list (x # xs) / n = x / n + ((1::'a) + (1::'a) / n) * sum_list xs - sum_list xs
[PROOF STEP]
have
      "\<Sum>:(x#xs) / n + \<Sum>:(x#xs) = x/n + (1+1/n)*\<Sum>:xs - \<Sum>:xs + \<Sum>:(x#xs)"
[PROOF STATE]
proof (prove)
using this:
sum_list (x # xs) / n = x / n + ((1::'a) + (1::'a) / n) * sum_list xs - sum_list xs

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = x / n + ((1::'a) + (1::'a) / n) * sum_list xs - sum_list xs + sum_list (x # xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (x # xs) / n + sum_list (x # xs) = x / n + ((1::'a) + (1::'a) / n) * sum_list xs - sum_list xs + sum_list (x # xs)

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (x # xs) / n + sum_list (x # xs) = x / n + ((1::'a) + (1::'a) / n) * sum_list xs - sum_list xs + sum_list (x # xs)

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
have
      "\<dots> = x/n + (1+(1/n)- 1)*\<Sum>:xs + \<Sum>:(x#xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x / n + ((1::'a) + (1::'a) / n) * sum_list xs - sum_list xs + sum_list (x # xs) = x / n + ((1::'a) + (1::'a) / n - (1::'a)) * sum_list xs + sum_list (x # xs)
[PROOF STEP]
by (subst mult_1_left [symmetric, of "\<Sum>:xs"]) (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
x / n + ((1::'a) + (1::'a) / n) * sum_list xs - sum_list xs + sum_list (x # xs) = x / n + ((1::'a) + (1::'a) / n - (1::'a)) * sum_list xs + sum_list (x # xs)

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x / n + ((1::'a) + (1::'a) / n) * sum_list xs - sum_list xs + sum_list (x # xs) = x / n + ((1::'a) + (1::'a) / n - (1::'a)) * sum_list xs + sum_list (x # xs)

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
have
      "\<dots> = x/n + (1/n)*\<Sum>:xs + \<Sum>:(x#xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x / n + ((1::'a) + (1::'a) / n - (1::'a)) * sum_list xs + sum_list (x # xs) = x / n + (1::'a) / n * sum_list xs + sum_list (x # xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x / n + ((1::'a) + (1::'a) / n - (1::'a)) * sum_list xs + sum_list (x # xs) = x / n + (1::'a) / n * sum_list xs + sum_list (x # xs)

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x / n + ((1::'a) + (1::'a) / n - (1::'a)) * sum_list xs + sum_list (x # xs) = x / n + (1::'a) / n * sum_list xs + sum_list (x # xs)

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
have
      "\<dots> = (1/n)*\<Sum>:(x#xs) + 1*\<Sum>:(x#xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x / n + (1::'a) / n * sum_list xs + sum_list (x # xs) = (1::'a) / n * sum_list (x # xs) + (1::'a) * sum_list (x # xs)
[PROOF STEP]
by(simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
x / n + (1::'a) / n * sum_list xs + sum_list (x # xs) = (1::'a) / n * sum_list (x # xs) + (1::'a) * sum_list (x # xs)

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_list (x # xs) / n + sum_list (x # xs) = (1::'a) / n * sum_list (x # xs) + (1::'a) * sum_list (x # xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_list (x # xs) / n + sum_list (x # xs) = (1::'a) / n * sum_list (x # xs) + (1::'a) * sum_list (x # xs)

goal (1 subgoal):
 1. sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum_list (x # xs) / n + sum_list (x # xs) = ((1::'a) + (1::'a) / n) * sum_list (x # xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_disc_lim:
  assumes "\<bar>c :: real\<bar> < 1"
  shows "(\<Sum>x. c^x * B) = B /(1-c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x. c ^ x * B) = B / (1 - c)
[PROOF STEP]
by (simp add: assms suminf_geometric summable_geometric suminf_mult2[symmetric])


[STATEMENT]
lemma CDIM_prod[simp]: "CDIM('a \<times> 'b) = CDIM('a) + CDIM('b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CDIM('a \<times> 'b) = CDIM('a) + CDIM('b)
[PROOF STEP]
unfolding CBasis_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>u. (u, 0::'b)) ` CBasis \<union> Pair (0::'a) ` CBasis) = CDIM('a) + CDIM('b)
[PROOF STEP]
by (subst card_Un_disjoint) (auto intro!: card_image arg_cong2[where f="(+)"] inj_onI)


[STATEMENT]
lemma card_eq_1_iff: "card A = Suc 0 \<longleftrightarrow> (\<exists>x. A = {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card A = Suc 0) = (\<exists>x. A = {x})
[PROOF STEP]
using card_eq_SucD
[PROOF STATE]
proof (prove)
using this:
card ?A = Suc ?k \<Longrightarrow> \<exists>b B. ?A = insert b B \<and> b \<notin> B \<and> card B = ?k \<and> (?k = 0 \<longrightarrow> B = {})

goal (1 subgoal):
 1. (card A = Suc 0) = (\<exists>x. A = {x})
[PROOF STEP]
by auto


[STATEMENT]
lemma alpha_l_beta_l_add_norm:
  "alpha_l l * alpha_l l + beta_l l * beta_l l = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alpha_l l * alpha_l l + beta_l l * beta_l l = 1
[PROOF STEP]
using alpha_l_def beta_l_def csin_ccos_squared_add
[PROOF STATE]
proof (prove)
using this:
alpha_l ?l = complex_of_real (cos ((real ?l + 1 / 2) * \<theta>))
beta_l ?l = complex_of_real (sin ((real ?l + 1 / 2) * \<theta>))
complex_of_real (cos ?a) * complex_of_real (cos ?a) + complex_of_real (sin ?a) * complex_of_real (sin ?a) = 1

goal (1 subgoal):
 1. alpha_l l * alpha_l l + beta_l l * beta_l l = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma scaleR_vector_assoc: "c *\<^sub>R (A *v x) = (c *\<^sub>R A) *v x" for x :: "('a::real_normed_algebra_1)^'n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c *\<^sub>R (A *v x) = c *\<^sub>R A *v x
[PROOF STEP]
unfolding matrix_vector_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c *\<^sub>R (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j * x $ j) = (\<chi>i. \<Sum>j\<in>UNIV. (c *\<^sub>R A) $ i $ j * x $ j)
[PROOF STEP]
by(auto simp: vec_eq_iff scaleR_right.sum)


[STATEMENT]
lemma SUP_sigma_sigma:
  "M \<noteq> {} \<Longrightarrow> (\<And>m. m \<in> M \<Longrightarrow> f m \<subseteq> Pow \<Omega>) \<Longrightarrow> (SUP m\<in>M. sigma \<Omega> (f m)) = sigma \<Omega> (\<Union>m\<in>M. f m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>M \<noteq> {}; \<And>m. m \<in> M \<Longrightarrow> f m \<subseteq> Pow \<Omega>\<rbrakk> \<Longrightarrow> (SUP m\<in>M. sigma \<Omega> (f m)) = sigma \<Omega> (\<Union> (f ` M))
[PROOF STEP]
using Sup_sigma[of "f`M" \<Omega>]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>f ` M \<noteq> {}; \<And>m. m \<in> f ` M \<Longrightarrow> m \<subseteq> Pow \<Omega>\<rbrakk> \<Longrightarrow> Sup (sigma \<Omega> ` f ` M) = sigma \<Omega> (\<Union> (f ` M))

goal (1 subgoal):
 1. \<lbrakk>M \<noteq> {}; \<And>m. m \<in> M \<Longrightarrow> f m \<subseteq> Pow \<Omega>\<rbrakk> \<Longrightarrow> (SUP m\<in>M. sigma \<Omega> (f m)) = sigma \<Omega> (\<Union> (f ` M))
[PROOF STEP]
by (auto simp: image_comp)


[STATEMENT]
lemma d_OUT_add: "d_OUT (\<lambda>e. f e + g e) x = d_OUT f x + d_OUT g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>e. f e + g e) x = d_OUT f x + d_OUT g x
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. f (x, y) + g (x, y)) = (\<Sum>\<^sup>+ y. f (x, y)) + (\<Sum>\<^sup>+ y. g (x, y))
[PROOF STEP]
by(simp add: nn_integral_add)


[STATEMENT]
lemma collect_suc_eq_lt[simp]:
  "{f i |i::nat. i < Suc n} = {f i |i. i = 0} \<union> {f (Suc i) |i. i < n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f i |i. i < Suc n} = {f i |i. i = 0} \<union> {f (Suc i) |i. i < n}
[PROOF STEP]
apply(induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {f i |i. i < Suc 0} = {f i |i. i = 0} \<union> {f (Suc i) |i. i < 0}
 2. \<And>n. {f i |i. i < Suc n} = {f i |i. i = 0} \<union> {f (Suc i) |i. i < n} \<Longrightarrow> {f i |i. i < Suc (Suc n)} = {f i |i. i = 0} \<union> {f (Suc i) |i. i < Suc n}
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. {f i |i. i < Suc n} = {f i |i. i = 0} \<union> {f (Suc i) |i. i < n} \<Longrightarrow> {f i |i. i < Suc (Suc n)} = {f i |i. i = 0} \<union> {f (Suc i) |i. i < Suc n}
[PROOF STEP]
apply(clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. {f i |i. i < Suc n} = insert (f 0) {f (Suc i) |i. i < n} \<Longrightarrow> {f i |i. i < Suc (Suc n)} = insert (f 0) {f (Suc i) |i. i < Suc n}
[PROOF STEP]
apply(simp add: less_Suc_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. {f i |i. i < n \<or> i = n} = insert (f 0) {f (Suc i) |i. i < n} \<Longrightarrow> {f i |i. i < n \<or> i = n \<or> i = Suc n} = insert (f 0) {f (Suc i) |i. i < n \<or> i = n}
[PROOF STEP]
apply(simp add: image_Collect[THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. f ` {i. i < n \<or> i = n} = insert (f 0) ((\<lambda>x. f (Suc x)) ` {i. i < n}) \<Longrightarrow> f ` {i. i < n \<or> i = n \<or> i = Suc n} = insert (f 0) ((\<lambda>x. f (Suc x)) ` {i. i < n \<or> i = n})
[PROOF STEP]
apply(simp add: Collect_disj_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. insert (f n) (f ` {i. i < n}) = insert (f 0) ((\<lambda>x. f (Suc x)) ` {i. i < n}) \<Longrightarrow> insert (f (Suc n)) (insert (f 0) ((\<lambda>x. f (Suc x)) ` {i. i < n})) = insert (f 0) (insert (f (Suc n)) ((\<lambda>x. f (Suc x)) ` {i. i < n}))
[PROOF STEP]
apply(blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sigma_sets_singletons:
  assumes "countable S"
  shows "sigma_sets S ((\<lambda>s. {s})`S) = Pow S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_sets S ((\<lambda>s. {s}) ` S) = Pow S
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>x \<in> sigma_sets S ((\<lambda>s. {s}) ` S); xa \<in> x\<rbrakk> \<Longrightarrow> xa \<in> S
 2. \<And>x. x \<subseteq> S \<Longrightarrow> x \<in> sigma_sets S ((\<lambda>s. {s}) ` S)
[PROOF STEP]
interpret sigma_algebra S "sigma_sets S ((\<lambda>s. {s})`S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra S (sigma_sets S ((\<lambda>s. {s}) ` S))
[PROOF STEP]
by (rule sigma_algebra_sigma_sets) auto
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>x \<in> sigma_sets S ((\<lambda>s. {s}) ` S); xa \<in> x\<rbrakk> \<Longrightarrow> xa \<in> S
 2. \<And>x. x \<subseteq> S \<Longrightarrow> x \<in> sigma_sets S ((\<lambda>s. {s}) ` S)
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>x \<in> sigma_sets S ((\<lambda>s. {s}) ` S); xa \<in> x\<rbrakk> \<Longrightarrow> xa \<in> S
 2. \<And>x. x \<subseteq> S \<Longrightarrow> x \<in> sigma_sets S ((\<lambda>s. {s}) ` S)
[PROOF STEP]
assume "A \<subseteq> S"
[PROOF STATE]
proof (state)
this:
A \<subseteq> S

goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>x \<in> sigma_sets S ((\<lambda>s. {s}) ` S); xa \<in> x\<rbrakk> \<Longrightarrow> xa \<in> S
 2. \<And>x. x \<subseteq> S \<Longrightarrow> x \<in> sigma_sets S ((\<lambda>s. {s}) ` S)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
countable S
A \<subseteq> S
[PROOF STEP]
have "(\<Union>a\<in>A. {a}) \<in> sigma_sets S ((\<lambda>s. {s})`S)"
[PROOF STATE]
proof (prove)
using this:
countable S
A \<subseteq> S

goal (1 subgoal):
 1. (\<Union>a\<in>A. {a}) \<in> sigma_sets S ((\<lambda>s. {s}) ` S)
[PROOF STEP]
by (intro countable_UN') (auto dest: countable_subset)
[PROOF STATE]
proof (state)
this:
(\<Union>a\<in>A. {a}) \<in> sigma_sets S ((\<lambda>s. {s}) ` S)

goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>x \<in> sigma_sets S ((\<lambda>s. {s}) ` S); xa \<in> x\<rbrakk> \<Longrightarrow> xa \<in> S
 2. \<And>x. x \<subseteq> S \<Longrightarrow> x \<in> sigma_sets S ((\<lambda>s. {s}) ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>a\<in>A. {a}) \<in> sigma_sets S ((\<lambda>s. {s}) ` S)
[PROOF STEP]
show "A \<in> sigma_sets S ((\<lambda>s. {s})`S)"
[PROOF STATE]
proof (prove)
using this:
(\<Union>a\<in>A. {a}) \<in> sigma_sets S ((\<lambda>s. {s}) ` S)

goal (1 subgoal):
 1. A \<in> sigma_sets S ((\<lambda>s. {s}) ` S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A \<in> sigma_sets S ((\<lambda>s. {s}) ` S)

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<in> sigma_sets S ((\<lambda>s. {s}) ` S); xa \<in> x\<rbrakk> \<Longrightarrow> xa \<in> S
[PROOF STEP]
qed (auto dest: sigma_sets_into_sp[rotated])


[STATEMENT]
lemma coeff_mult: "coeff (p * q) n = (\<Sum>i\<le>n. coeff p i * coeff q (n-i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (p * q) n = (\<Sum>i\<le>n. coeff p i * coeff q (n - i))
[PROOF STEP]
proof (induct p arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. coeff (0 * q) n = (\<Sum>i\<le>n. coeff 0 i * coeff q (n - i))
 2. \<And>a p n. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<And>n. coeff (p * q) n = (\<Sum>i\<le>n. coeff p i * coeff q (n - i))\<rbrakk> \<Longrightarrow> coeff (pCons a p * q) n = (\<Sum>i\<le>n. coeff (pCons a p) i * coeff q (n - i))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>n. coeff (0 * q) n = (\<Sum>i\<le>n. coeff 0 i * coeff q (n - i))
 2. \<And>a p n. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<And>n. coeff (p * q) n = (\<Sum>i\<le>n. coeff p i * coeff q (n - i))\<rbrakk> \<Longrightarrow> coeff (pCons a p * q) n = (\<Sum>i\<le>n. coeff (pCons a p) i * coeff q (n - i))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (0 * q) n = (\<Sum>i\<le>n. coeff 0 i * coeff q (n - i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coeff (0 * q) n = (\<Sum>i\<le>n. coeff 0 i * coeff q (n - i))

goal (1 subgoal):
 1. \<And>a p n. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<And>n. coeff (p * q) n = (\<Sum>i\<le>n. coeff p i * coeff q (n - i))\<rbrakk> \<Longrightarrow> coeff (pCons a p * q) n = (\<Sum>i\<le>n. coeff (pCons a p) i * coeff q (n - i))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p n. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<And>n. coeff (p * q) n = (\<Sum>i\<le>n. coeff p i * coeff q (n - i))\<rbrakk> \<Longrightarrow> coeff (pCons a p * q) n = (\<Sum>i\<le>n. coeff (pCons a p) i * coeff q (n - i))
[PROOF STEP]
case (pCons a p n)
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a) \<or> p \<noteq> 0
coeff (p * q) ?n = (\<Sum>i\<le>?n. coeff p i * coeff q (?n - i))

goal (1 subgoal):
 1. \<And>a p n. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; \<And>n. coeff (p * q) n = (\<Sum>i\<le>n. coeff p i * coeff q (n - i))\<rbrakk> \<Longrightarrow> coeff (pCons a p * q) n = (\<Sum>i\<le>n. coeff (pCons a p) i * coeff q (n - i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a) \<or> p \<noteq> 0
coeff (p * q) ?n = (\<Sum>i\<le>?n. coeff p i * coeff q (?n - i))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a) \<or> p \<noteq> 0
coeff (p * q) ?n = (\<Sum>i\<le>?n. coeff p i * coeff q (?n - i))

goal (1 subgoal):
 1. coeff (pCons a p * q) n = (\<Sum>i\<le>n. coeff (pCons a p) i * coeff q (n - i))
[PROOF STEP]
by (cases n) (simp_all add: sum.atMost_Suc_shift del: sum.atMost_Suc)
[PROOF STATE]
proof (state)
this:
coeff (pCons a p * q) n = (\<Sum>i\<le>n. coeff (pCons a p) i * coeff q (n - i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_union_disjoint':
  assumes "finite A"
    and "finite B"
    and "A \<inter> B = {}"
    and "A \<union> B = C"
  shows "sum g C = sum g A + sum g B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g C = sum g A + sum g B
[PROOF STEP]
using sum.union_disjoint[OF assms(1-3)] and assms(4)
[PROOF STATE]
proof (prove)
using this:
sum ?g (A \<union> B) = sum ?g A + sum ?g B
A \<union> B = C

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


[STATEMENT]
lemma arcosh_mono:
  fixes x y::real
  assumes "x \<ge> 1" "y \<ge> 1"
  shows "arcosh x \<ge> arcosh y \<longleftrightarrow> x \<ge> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (arcosh y \<le> arcosh x) = (y \<le> x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> x
1 \<le> y

goal (1 subgoal):
 1. (arcosh y \<le> arcosh x) = (y \<le> x)
[PROOF STEP]
by (smt arcosh_ge_0 cosh_arcosh cosh_real_nonneg_less_iff)


[STATEMENT]
lemma unitary_inner_prod:
  assumes "v\<in> carrier_vec n"
  and "w \<in> carrier_vec n"
  and "U \<in> carrier_mat n n"
  and "Complex_Matrix.unitary U"
shows "inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = inner_prod v w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod v w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod v w
[PROOF STEP]
have "inner_prod (U *\<^sub>v v) (U *\<^sub>v w) =
    inner_prod (((Complex_Matrix.adjoint U) * U) *\<^sub>v v) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod (Complex_Matrix.adjoint U * U *\<^sub>v v) w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n
U \<in> carrier_mat n n
Complex_Matrix.unitary U

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod (Complex_Matrix.adjoint U * U *\<^sub>v v) w
[PROOF STEP]
by (simp add: inner_prod_mult_mat_vec_left)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod (Complex_Matrix.adjoint U * U *\<^sub>v v) w

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod v w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod (Complex_Matrix.adjoint U * U *\<^sub>v v) w

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod v w
[PROOF STEP]
have "... = inner_prod (1\<^sub>m n *\<^sub>v v) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (Complex_Matrix.adjoint U * U *\<^sub>v v) w = Complex_Matrix.inner_prod (1\<^sub>m n *\<^sub>v v) w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n
U \<in> carrier_mat n n
Complex_Matrix.unitary U

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (Complex_Matrix.adjoint U * U *\<^sub>v v) w = Complex_Matrix.inner_prod (1\<^sub>m n *\<^sub>v v) w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (Complex_Matrix.adjoint U * U *\<^sub>v v) w = Complex_Matrix.inner_prod (1\<^sub>m n *\<^sub>v v) w

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod v w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (Complex_Matrix.adjoint U * U *\<^sub>v v) w = Complex_Matrix.inner_prod (1\<^sub>m n *\<^sub>v v) w

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod v w
[PROOF STEP]
have "... = inner_prod v w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (1\<^sub>m n *\<^sub>v v) w = Complex_Matrix.inner_prod v w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n
U \<in> carrier_mat n n
Complex_Matrix.unitary U

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (1\<^sub>m n *\<^sub>v v) w = Complex_Matrix.inner_prod v w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (1\<^sub>m n *\<^sub>v v) w = Complex_Matrix.inner_prod v w

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

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod v w
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (U *\<^sub>v v) (U *\<^sub>v w) = Complex_Matrix.inner_prod v w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conv_radius_mult_ge:
  fixes f g :: "nat \<Rightarrow> ('a :: {banach,real_normed_div_algebra})"
  shows "conv_radius (\<lambda>x. \<Sum>i\<le>x. f i * g (x - i)) \<ge> min (conv_radius f) (conv_radius g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (conv_radius f) (conv_radius g) \<le> conv_radius (\<lambda>x. \<Sum>i\<le>x. f i * g (x - i))
[PROOF STEP]
proof (rule conv_radius_geI_ex')
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>0 < r; ereal r < min (conv_radius f) (conv_radius g)\<rbrakk> \<Longrightarrow> summable (\<lambda>n. (\<Sum>i\<le>n. f i * g (n - i)) * of_real r ^ n)
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>0 < r; ereal r < min (conv_radius f) (conv_radius g)\<rbrakk> \<Longrightarrow> summable (\<lambda>n. (\<Sum>i\<le>n. f i * g (n - i)) * of_real r ^ n)
[PROOF STEP]
assume r: "r > 0" "ereal r < min (conv_radius f) (conv_radius g)"
[PROOF STATE]
proof (state)
this:
0 < r
ereal r < min (conv_radius f) (conv_radius g)

goal (1 subgoal):
 1. \<And>r. \<lbrakk>0 < r; ereal r < min (conv_radius f) (conv_radius g)\<rbrakk> \<Longrightarrow> summable (\<lambda>n. (\<Sum>i\<le>n. f i * g (n - i)) * of_real r ^ n)
[PROOF STEP]
from r
[PROOF STATE]
proof (chain)
picking this:
0 < r
ereal r < min (conv_radius f) (conv_radius g)
[PROOF STEP]
have "summable (\<lambda>n. (\<Sum>i\<le>n. (f i * of_real r^i) * (g (n - i) * of_real r^(n - i))))"
[PROOF STATE]
proof (prove)
using this:
0 < r
ereal r < min (conv_radius f) (conv_radius g)

goal (1 subgoal):
 1. summable (\<lambda>n. \<Sum>i\<le>n. f i * of_real r ^ i * (g (n - i) * of_real r ^ (n - i)))
[PROOF STEP]
by (intro summable_Cauchy_product abs_summable_in_conv_radius) simp_all
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. \<Sum>i\<le>n. f i * of_real r ^ i * (g (n - i) * of_real r ^ (n - i)))

goal (1 subgoal):
 1. \<And>r. \<lbrakk>0 < r; ereal r < min (conv_radius f) (conv_radius g)\<rbrakk> \<Longrightarrow> summable (\<lambda>n. (\<Sum>i\<le>n. f i * g (n - i)) * of_real r ^ n)
[PROOF STEP]
thus "summable (\<lambda>n. (\<Sum>i\<le>n. f i * g (n - i)) * of_real r ^ n)"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. \<Sum>i\<le>n. f i * of_real r ^ i * (g (n - i) * of_real r ^ (n - i)))

goal (1 subgoal):
 1. summable (\<lambda>n. (\<Sum>i\<le>n. f i * g (n - i)) * of_real r ^ n)
[PROOF STEP]
by (simp add: algebra_simps of_real_def power_add [symmetric] scaleR_sum_right)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (\<Sum>i\<le>n. f i * g (n - i)) * of_real r ^ n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm003:
  assumes "\<forall> x1 \<in> X. (x1 \<noteq> {} & (\<forall> x2 \<in> X-{x1}. x1 \<inter> x2  =  {}))"
  shows "is_non_overlapping X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_non_overlapping X
[PROOF STEP]
unfolding is_non_overlapping_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Xa\<in>X. \<forall>Y\<in>X. (Xa \<inter> Y \<noteq> {}) = (Xa = Y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x1\<in>X. x1 \<noteq> {} \<and> (\<forall>x2\<in>X - {x1}. x1 \<inter> x2 = {})

goal (1 subgoal):
 1. \<forall>Xa\<in>X. \<forall>Y\<in>X. (Xa \<inter> Y \<noteq> {}) = (Xa = Y)
[PROOF STEP]
by fast


[STATEMENT]
lemma not_less_Ord_Least: "\<lbrakk>k < (LEAST x. Ord x \<and> P x); Ord k\<rbrakk> \<Longrightarrow> \<not> P k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k < (LEAST x. Ord x \<and> P x); Ord k\<rbrakk> \<Longrightarrow> \<not> P k
[PROOF STEP]
using Ord_Least_le less_le_not_le
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Ord ?k; ?P ?k\<rbrakk> \<Longrightarrow> (LEAST i. Ord i \<and> ?P i) \<le> ?k
(?x < ?y) = (?x \<le> ?y \<and> \<not> ?y \<le> ?x)

goal (1 subgoal):
 1. \<lbrakk>k < (LEAST x. Ord x \<and> P x); Ord k\<rbrakk> \<Longrightarrow> \<not> P k
[PROOF STEP]
by auto


[STATEMENT]
lemma det_cols_mult: "det (upd_cols M T (\<lambda>i. c i *s a i)) = (\<Prod>i\<in>T. c i) * det (upd_cols M T a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (upd_cols M T (\<lambda>i. c i *s a i)) = prod c T * Square_Matrix.det (upd_cols M T a)
[PROOF STEP]
using det_rows_mult[of "transpose M" T c a]
[PROOF STATE]
proof (prove)
using this:
Square_Matrix.det (upd_rows (Square_Matrix.transpose M) T (\<lambda>i. c i *s a i)) = prod c T * Square_Matrix.det (upd_rows (Square_Matrix.transpose M) T a)

goal (1 subgoal):
 1. Square_Matrix.det (upd_cols M T (\<lambda>i. c i *s a i)) = prod c T * Square_Matrix.det (upd_cols M T a)
[PROOF STEP]
by (simp add: det_transpose upd_rows_transpose)


[STATEMENT]
lemma coplanar_translation_imp:
  assumes "coplanar S" shows "coplanar ((\<lambda>x. a + x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coplanar ((+) a ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coplanar ((+) a ` S)
[PROOF STEP]
obtain u v w where "S \<subseteq> affine hull {u,v,w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u v w. S \<subseteq> affine hull {u, v, w} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson assms coplanar_def)
[PROOF STATE]
proof (state)
this:
S \<subseteq> affine hull {u, v, w}

goal (1 subgoal):
 1. coplanar ((+) a ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<subseteq> affine hull {u, v, w}
[PROOF STEP]
have "(+) a ` S \<subseteq> affine hull {u + a, v + a, w + a}"
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> affine hull {u, v, w}

goal (1 subgoal):
 1. (+) a ` S \<subseteq> affine hull {u + a, v + a, w + a}
[PROOF STEP]
using affine_hull_translation [of a "{u,v,w}" for u v w]
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> affine hull {u, v, w}
affine hull (+) a ` {?ua2, ?va2, ?wa2} = (+) a ` (affine hull {?ua2, ?va2, ?wa2})

goal (1 subgoal):
 1. (+) a ` S \<subseteq> affine hull {u + a, v + a, w + a}
[PROOF STEP]
by (force simp: add.commute)
[PROOF STATE]
proof (state)
this:
(+) a ` S \<subseteq> affine hull {u + a, v + a, w + a}

goal (1 subgoal):
 1. coplanar ((+) a ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(+) a ` S \<subseteq> affine hull {u + a, v + a, w + a}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(+) a ` S \<subseteq> affine hull {u + a, v + a, w + a}

goal (1 subgoal):
 1. coplanar ((+) a ` S)
[PROOF STEP]
unfolding coplanar_def
[PROOF STATE]
proof (prove)
using this:
(+) a ` S \<subseteq> affine hull {u + a, v + a, w + a}

goal (1 subgoal):
 1. \<exists>u v w. (+) a ` S \<subseteq> affine hull {u, v, w}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
coplanar ((+) a ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem inrange: assumes "invar_vebt t n" shows " set_vebt' t \<subseteq> {0..2^n-1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_vebt' t \<subseteq> {0..2 ^ n - 1}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set_vebt' t \<Longrightarrow> x \<in> {0..2 ^ n - 1}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set_vebt' t \<Longrightarrow> x \<in> {0..2 ^ n - 1}
[PROOF STEP]
assume "x \<in> set_vebt' t"
[PROOF STATE]
proof (state)
this:
x \<in> set_vebt' t

goal (1 subgoal):
 1. \<And>x. x \<in> set_vebt' t \<Longrightarrow> x \<in> {0..2 ^ n - 1}
[PROOF STEP]
hence "vebt_member t x"
[PROOF STATE]
proof (prove)
using this:
x \<in> set_vebt' t

goal (1 subgoal):
 1. vebt_member t x
[PROOF STEP]
using set_vebt'_def
[PROOF STATE]
proof (prove)
using this:
x \<in> set_vebt' t
set_vebt' ?t = {x. vebt_member ?t x}

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

goal (1 subgoal):
 1. \<And>x. x \<in> set_vebt' t \<Longrightarrow> x \<in> {0..2 ^ n - 1}
[PROOF STEP]
hence "x < 2^n"
[PROOF STATE]
proof (prove)
using this:
vebt_member t x

goal (1 subgoal):
 1. x < 2 ^ n
[PROOF STEP]
using assms member_bound
[PROOF STATE]
proof (prove)
using this:
vebt_member t x
invar_vebt t n
\<lbrakk>vebt_member ?tree ?x; invar_vebt ?tree ?n\<rbrakk> \<Longrightarrow> ?x < 2 ^ ?n

goal (1 subgoal):
 1. x < 2 ^ n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x < 2 ^ n

goal (1 subgoal):
 1. \<And>x. x \<in> set_vebt' t \<Longrightarrow> x \<in> {0..2 ^ n - 1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < 2 ^ n
[PROOF STEP]
show "x \<in> {0..2^n-1}"
[PROOF STATE]
proof (prove)
using this:
x < 2 ^ n

goal (1 subgoal):
 1. x \<in> {0..2 ^ n - 1}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> {0..2 ^ n - 1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_deriv_inverse [simp]:
  fixes f :: "'a :: {real_algebra, field} fds"
  assumes "fds_nth f (Suc 0) \<noteq> 0"
  shows   "fds_deriv (inverse f) = -fds_deriv f / f ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
have "(0 :: 'a fds) = fds_deriv 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = fds_deriv 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 = fds_deriv 1

goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 = fds_deriv 1

goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
fds_nth f (Suc 0) \<noteq> (0::'a)
[PROOF STEP]
have "(1 :: 'a fds) = inverse f * f"
[PROOF STATE]
proof (prove)
using this:
fds_nth f (Suc 0) \<noteq> (0::'a)

goal (1 subgoal):
 1. 1 = inverse f * f
[PROOF STEP]
by (simp add: fds_left_inverse)
[PROOF STATE]
proof (state)
this:
1 = inverse f * f

goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 = inverse f * f

goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
have "fds_deriv \<dots> = fds_deriv (inverse f) * f + inverse f * fds_deriv f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_deriv (inverse f * f) = fds_deriv (inverse f) * f + inverse f * fds_deriv f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fds_deriv (inverse f * f) = fds_deriv (inverse f) * f + inverse f * fds_deriv f

goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_deriv (inverse f * f) = fds_deriv (inverse f) * f + inverse f * fds_deriv f

goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
have "\<dots> * inverse f = fds_deriv (inverse f) * (f * inverse f) +
                                inverse f ^ 2 * fds_deriv f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fds_deriv (inverse f) * f + inverse f * fds_deriv f) * inverse f = fds_deriv (inverse f) * (f * inverse f) + (inverse f)\<^sup>2 * fds_deriv f
[PROOF STEP]
by (simp add: algebra_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
(fds_deriv (inverse f) * f + inverse f * fds_deriv f) * inverse f = fds_deriv (inverse f) * (f * inverse f) + (inverse f)\<^sup>2 * fds_deriv f

goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(fds_deriv (inverse f) * f + inverse f * fds_deriv f) * inverse f = fds_deriv (inverse f) * (f * inverse f) + (inverse f)\<^sup>2 * fds_deriv f

goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
fds_nth f (Suc 0) \<noteq> (0::'a)
[PROOF STEP]
have "f * inverse f = 1"
[PROOF STATE]
proof (prove)
using this:
fds_nth f (Suc 0) \<noteq> (0::'a)

goal (1 subgoal):
 1. f * inverse f = 1
[PROOF STEP]
by (simp add: fds_right_inverse)
[PROOF STATE]
proof (state)
this:
f * inverse f = 1

goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 * inverse f = fds_deriv (inverse f) * 1 + (inverse f)\<^sup>2 * fds_deriv f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 * inverse f = fds_deriv (inverse f) * 1 + (inverse f)\<^sup>2 * fds_deriv f

goal (1 subgoal):
 1. fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2
[PROOF STEP]
by (simp add: algebra_simps power2_eq_square divide_fds_def inverse_mult_fds add_eq_0_iff)
[PROOF STATE]
proof (state)
this:
fds_deriv (inverse f) = - fds_deriv f / f\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed