[STATEMENT]
theorem Stone_Weierstrass_polynomial_function_subspace:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "compact S"
      and contf: "continuous_on S f"
      and "0 < e"
      and "subspace T" "f ` S \<subseteq> T"
    obtains g where "polynomial_function g" "g ` S \<subseteq> T"
                    "\<And>x. x \<in> S \<Longrightarrow> norm(f x - g x) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; g ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; g ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain B where "B \<subseteq> T" and orthB: "pairwise orthogonal B"
             and B1: "\<And>x. x \<in> B \<Longrightarrow> norm x = 1"
             and "independent B" and cardB: "card B = dim T"
             and spanB: "span B = T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>B \<subseteq> T; pairwise orthogonal B; \<And>x. x \<in> B \<Longrightarrow> norm x = 1; independent B; card B = dim T; span B = T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using orthonormal_basis_subspace \<open>subspace T\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>subspace ?S; \<And>B. \<lbrakk>B \<subseteq> ?S; pairwise orthogonal B; \<And>x. x \<in> B \<Longrightarrow> norm x = 1; independent B; card B = dim ?S; span B = ?S\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
subspace T

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>B \<subseteq> T; pairwise orthogonal B; \<And>x. x \<in> B \<Longrightarrow> norm x = 1; independent B; card B = dim T; span B = T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
B \<subseteq> T
pairwise orthogonal B
?x \<in> B \<Longrightarrow> norm ?x = 1
independent B
card B = dim T
span B = T

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; g ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B \<subseteq> T
pairwise orthogonal B
?x \<in> B \<Longrightarrow> norm ?x = 1
independent B
card B = dim T
span B = T
[PROOF STEP]
have "finite B"
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> T
pairwise orthogonal B
?x \<in> B \<Longrightarrow> norm ?x = 1
independent B
card B = dim T
span B = T

goal (1 subgoal):
 1. finite B
[PROOF STEP]
by (simp add: independent_imp_finite)
[PROOF STATE]
proof (state)
this:
finite B

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; g ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite B
[PROOF STEP]
obtain n::nat and b where "B = b ` {i. i < n}" "inj_on b {i. i < n}"
[PROOF STATE]
proof (prove)
using this:
finite B

goal (1 subgoal):
 1. (\<And>b n. \<lbrakk>B = b ` {i. i < n}; inj_on b {i. i < n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using finite_imp_nat_seg_image_inj_on
[PROOF STATE]
proof (prove)
using this:
finite B
finite ?A \<Longrightarrow> \<exists>n f. ?A = f ` {i. i < n} \<and> inj_on f {i. i < n}

goal (1 subgoal):
 1. (\<And>b n. \<lbrakk>B = b ` {i. i < n}; inj_on b {i. i < n}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
B = b ` {i. i < n}
inj_on b {i. i < n}

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; g ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with cardB
[PROOF STATE]
proof (chain)
picking this:
card B = dim T
B = b ` {i. i < n}
inj_on b {i. i < n}
[PROOF STEP]
have "n = card B" "dim T = n"
[PROOF STATE]
proof (prove)
using this:
card B = dim T
B = b ` {i. i < n}
inj_on b {i. i < n}

goal (1 subgoal):
 1. n = card B &&& dim T = n
[PROOF STEP]
by (auto simp: card_image)
[PROOF STATE]
proof (state)
this:
n = card B
dim T = n

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; g ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have fx: "(\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i) = f x" if "x \<in> S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i) = f x
[PROOF STEP]
by (metis (no_types, lifting) B1 \<open>finite B\<close> assms(5) image_subset_iff orthB orthonormal_basis_expand spanB sum.cong that)
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> (\<Sum>i\<in>B. (f ?x \<bullet> i) *\<^sub>R i) = f ?x

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; g ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have cont: "continuous_on S (\<lambda>x. \<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (\<lambda>x. \<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i)
[PROOF STEP]
by (intro continuous_intros contf)
[PROOF STATE]
proof (state)
this:
continuous_on S (\<lambda>x. \<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i)

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; g ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain g where "polynomial_function g"
             and g: "\<And>x. x \<in> S \<Longrightarrow> norm ((\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i) - g x) < e / (n+2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; \<And>x. x \<in> S \<Longrightarrow> norm ((\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i) - g x) < e / real (n + 2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Stone_Weierstrass_polynomial_function [OF \<open>compact S\<close> cont, of "e / real (n + 2)"] \<open>0 < e\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e / real (n + 2) \<Longrightarrow> \<exists>g. polynomial_function g \<and> (\<forall>x\<in>S. norm ((\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i) - g x) < e / real (n + 2))
0 < e

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; \<And>x. x \<in> S \<Longrightarrow> norm ((\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i) - g x) < e / real (n + 2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
polynomial_function g
?x \<in> S \<Longrightarrow> norm ((\<Sum>i\<in>B. (f ?x \<bullet> i) *\<^sub>R i) - g ?x) < e / real (n + 2)

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; g ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with fx
[PROOF STATE]
proof (chain)
picking this:
?x \<in> S \<Longrightarrow> (\<Sum>i\<in>B. (f ?x \<bullet> i) *\<^sub>R i) = f ?x
polynomial_function g
?x \<in> S \<Longrightarrow> norm ((\<Sum>i\<in>B. (f ?x \<bullet> i) *\<^sub>R i) - g ?x) < e / real (n + 2)
[PROOF STEP]
have g: "\<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e / (n+2)"
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> (\<Sum>i\<in>B. (f ?x \<bullet> i) *\<^sub>R i) = f ?x
polynomial_function g
?x \<in> S \<Longrightarrow> norm ((\<Sum>i\<in>B. (f ?x \<bullet> i) *\<^sub>R i) - g ?x) < e / real (n + 2)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e / real (n + 2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> norm (f ?x - g ?x) < e / real (n + 2)

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>polynomial_function g; g ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x - g x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. polynomial_function ?g
 2. ?g ` S \<subseteq> T
 3. \<And>x. x \<in> S \<Longrightarrow> norm (f x - ?g x) < e
[PROOF STEP]
show "polynomial_function (\<lambda>x. \<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polynomial_function (\<lambda>x. \<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)
[PROOF STEP]
using \<open>polynomial_function g\<close>
[PROOF STATE]
proof (prove)
using this:
polynomial_function g

goal (1 subgoal):
 1. polynomial_function (\<lambda>x. \<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)
[PROOF STEP]
by (force intro: \<open>finite B\<close>)
[PROOF STATE]
proof (state)
this:
polynomial_function (\<lambda>x. \<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)

goal (2 subgoals):
 1. (\<lambda>x. \<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i) ` S \<subseteq> T
 2. \<And>x. x \<in> S \<Longrightarrow> norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
show "(\<lambda>x. \<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i) ` S \<subseteq> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i) ` S \<subseteq> T
[PROOF STEP]
using \<open>B \<subseteq> T\<close>
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> T

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i) ` S \<subseteq> T
[PROOF STEP]
by (blast intro: subspace_sum subspace_mul \<open>subspace T\<close>)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i) ` S \<subseteq> T

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
show "norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e" if "x \<in> S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
have orth': "pairwise (\<lambda>i j. orthogonal ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i)
                                              ((f x \<bullet> j) *\<^sub>R j - (g x \<bullet> j) *\<^sub>R j)) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise (\<lambda>i j. orthogonal ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i) ((f x \<bullet> j) *\<^sub>R j - (g x \<bullet> j) *\<^sub>R j)) B
[PROOF STEP]
by (auto simp: orthogonal_def inner_diff_right inner_diff_left intro: pairwise_mono [OF orthB])
[PROOF STATE]
proof (state)
this:
pairwise (\<lambda>i j. orthogonal ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i) ((f x \<bullet> j) *\<^sub>R j - (g x \<bullet> j) *\<^sub>R j)) B

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pairwise (\<lambda>i j. orthogonal ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i) ((f x \<bullet> j) *\<^sub>R j - (g x \<bullet> j) *\<^sub>R j)) B
[PROOF STEP]
have "(norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2 =
                 (\<Sum>i\<in>B. (norm ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
pairwise (\<lambda>i j. orthogonal ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i) ((f x \<bullet> j) *\<^sub>R j - (g x \<bullet> j) *\<^sub>R j)) B

goal (1 subgoal):
 1. (norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2 = (\<Sum>i\<in>B. (norm ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2)
[PROOF STEP]
by (simp add:  norm_sum_Pythagorean [OF \<open>finite B\<close> orth'])
[PROOF STATE]
proof (state)
this:
(norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2 = (\<Sum>i\<in>B. (norm ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2)

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2 = (\<Sum>i\<in>B. (norm ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2)

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
have "... = (\<Sum>i\<in>B. (norm (((f x - g x) \<bullet> i) *\<^sub>R i))\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>B. (norm ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2) = (\<Sum>i\<in>B. (norm (((f x - g x) \<bullet> i) *\<^sub>R i))\<^sup>2)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>B. (norm ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2) = (\<Sum>i\<in>B. (norm (((f x - g x) \<bullet> i) *\<^sub>R i))\<^sup>2)

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>B. (norm ((f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2) = (\<Sum>i\<in>B. (norm (((f x - g x) \<bullet> i) *\<^sub>R i))\<^sup>2)

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
have "... \<le> (\<Sum>i\<in>B. (norm (f x - g x))\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>B. (norm (((f x - g x) \<bullet> i) *\<^sub>R i))\<^sup>2) \<le> (\<Sum>i\<in>B. (norm (f x - g x))\<^sup>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<in>B. (norm (((f x - g x) \<bullet> i) *\<^sub>R i))\<^sup>2) \<le> (\<Sum>i\<in>B. (norm (f x - g x))\<^sup>2)
[PROOF STEP]
have "\<And>i. i \<in> B \<Longrightarrow> ((f x - g x) \<bullet> i)\<^sup>2 \<le> (norm (f x - g x))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> B \<Longrightarrow> ((f x - g x) \<bullet> i)\<^sup>2 \<le> (norm (f x - g x))\<^sup>2
[PROOF STEP]
by (metis B1 Cauchy_Schwarz_ineq inner_commute mult.left_neutral norm_eq_1 power2_norm_eq_inner)
[PROOF STATE]
proof (state)
this:
?i \<in> B \<Longrightarrow> ((f x - g x) \<bullet> ?i)\<^sup>2 \<le> (norm (f x - g x))\<^sup>2

goal (1 subgoal):
 1. (\<Sum>i\<in>B. (norm (((f x - g x) \<bullet> i) *\<^sub>R i))\<^sup>2) \<le> (\<Sum>i\<in>B. (norm (f x - g x))\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<in> B \<Longrightarrow> ((f x - g x) \<bullet> ?i)\<^sup>2 \<le> (norm (f x - g x))\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?i \<in> B \<Longrightarrow> ((f x - g x) \<bullet> ?i)\<^sup>2 \<le> (norm (f x - g x))\<^sup>2

goal (1 subgoal):
 1. (\<Sum>i\<in>B. (norm (((f x - g x) \<bullet> i) *\<^sub>R i))\<^sup>2) \<le> (\<Sum>i\<in>B. (norm (f x - g x))\<^sup>2)
[PROOF STEP]
by (intro sum_mono) (simp add: sum_mono B1)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>B. (norm (((f x - g x) \<bullet> i) *\<^sub>R i))\<^sup>2) \<le> (\<Sum>i\<in>B. (norm (f x - g x))\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>B. (norm (((f x - g x) \<bullet> i) *\<^sub>R i))\<^sup>2) \<le> (\<Sum>i\<in>B. (norm (f x - g x))\<^sup>2)

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>B. (norm (((f x - g x) \<bullet> i) *\<^sub>R i))\<^sup>2) \<le> (\<Sum>i\<in>B. (norm (f x - g x))\<^sup>2)

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
have "... = n * norm (f x - g x)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>B. (norm (f x - g x))\<^sup>2) = real n * (norm (f x - g x))\<^sup>2
[PROOF STEP]
by (simp add: \<open>n = card B\<close>)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>B. (norm (f x - g x))\<^sup>2) = real n * (norm (f x - g x))\<^sup>2

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>B. (norm (f x - g x))\<^sup>2) = real n * (norm (f x - g x))\<^sup>2

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
have "... \<le> n * (e / (n+2))^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n * (norm (f x - g x))\<^sup>2 \<le> real n * (e / real (n + 2))\<^sup>2
[PROOF STEP]
proof (rule mult_left_mono)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (norm (f x - g x))\<^sup>2 \<le> (e / real (n + 2))\<^sup>2
 2. 0 \<le> real n
[PROOF STEP]
show "(norm (f x - g x))\<^sup>2 \<le> (e / real (n + 2))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (f x - g x))\<^sup>2 \<le> (e / real (n + 2))\<^sup>2
[PROOF STEP]
by (meson dual_order.order_iff_strict g norm_ge_zero power_mono that)
[PROOF STATE]
proof (state)
this:
(norm (f x - g x))\<^sup>2 \<le> (e / real (n + 2))\<^sup>2

goal (1 subgoal):
 1. 0 \<le> real n
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
real n * (norm (f x - g x))\<^sup>2 \<le> real n * (e / real (n + 2))\<^sup>2

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real n * (norm (f x - g x))\<^sup>2 \<le> real n * (e / real (n + 2))\<^sup>2

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
have "... \<le> e^2 / (n+2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n * (e / real (n + 2))\<^sup>2 \<le> e\<^sup>2 / real (n + 2)
[PROOF STEP]
using \<open>0 < e\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. real n * (e / real (n + 2))\<^sup>2 \<le> e\<^sup>2 / real (n + 2)
[PROOF STEP]
by (simp add: divide_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
real n * (e / real (n + 2))\<^sup>2 \<le> e\<^sup>2 / real (n + 2)

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real n * (e / real (n + 2))\<^sup>2 \<le> e\<^sup>2 / real (n + 2)

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
have "... < e^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e\<^sup>2 / real (n + 2) < e\<^sup>2
[PROOF STEP]
using \<open>0 < e\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. e\<^sup>2 / real (n + 2) < e\<^sup>2
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
e\<^sup>2 / real (n + 2) < e\<^sup>2

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2 < e\<^sup>2
[PROOF STEP]
have "(norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2 < e^2"
[PROOF STATE]
proof (prove)
using this:
(norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2 < e\<^sup>2

goal (1 subgoal):
 1. (norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2 < e\<^sup>2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2 < e\<^sup>2

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2 < e\<^sup>2
[PROOF STEP]
have "(norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i)) < e"
[PROOF STATE]
proof (prove)
using this:
(norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i))\<^sup>2 < e\<^sup>2

goal (1 subgoal):
 1. norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i) < e
[PROOF STEP]
by (simp add: \<open>0 < e\<close> norm_lt_square power2_norm_eq_inner)
[PROOF STATE]
proof (state)
this:
norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i) < e

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i) < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i) < e

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
using fx that
[PROOF STATE]
proof (prove)
using this:
norm (\<Sum>i\<in>B. (f x \<bullet> i) *\<^sub>R i - (g x \<bullet> i) *\<^sub>R i) < e
?x \<in> S \<Longrightarrow> (\<Sum>i\<in>B. (f ?x \<bullet> i) *\<^sub>R i) = f ?x
x \<in> S

goal (1 subgoal):
 1. norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e
[PROOF STEP]
by (simp add: sum_subtractf)
[PROOF STATE]
proof (state)
this:
norm (f x - (\<Sum>i\<in>B. (g x \<bullet> i) *\<^sub>R i)) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> norm (f ?x - (\<Sum>i\<in>B. (g ?x \<bullet> i) *\<^sub>R i)) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) int_pow_eq:
   "x \<in> carrier G \<Longrightarrow> (x [^] m = x [^] n) \<longleftrightarrow> int (ord x) dvd (n - m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> (x [^] m = x [^] n) = (int (ord x) dvd n - m)
[PROOF STEP]
apply (simp flip: int_pow_eq_id)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> (x [^] m = x [^] n) = (x [^] (n - m) = \<one>)
[PROOF STEP]
by (metis int_pow_closed int_pow_diff inv_closed r_inv right_cancel)


[STATEMENT]
lemma unbounded_nat_set_infinite: assumes \<open>\<forall> (i::nat). \<exists> j\<ge>i. j \<in> A\<close> shows \<open>\<not> finite A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i. \<exists>j\<ge>i. j \<in> A

goal (1 subgoal):
 1. infinite A
[PROOF STEP]
by (metis finite_nat_set_iff_bounded_le not_less_eq_eq)


[STATEMENT]
lemma size_filter_ne_elem: "x \<in># M \<Longrightarrow> size {#y \<in># M. y \<noteq> x#} < size M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in># M \<Longrightarrow> size {#y \<in># M. y \<noteq> x#} < size M
[PROOF STEP]
by (simp add: size_filter_unsat_elem[of x M "\<lambda>y. y \<noteq> x"])


[STATEMENT]
lemma card_arcs_da: "card (arcs G) = 2 + card (arcs H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (arcs G) = 2 + card (arcs H)
[PROOF STEP]
using arcs_G arcs_not_in a_neq_a'
[PROOF STATE]
proof (prove)
using this:
arcs G = insert a (insert a' (arcs H))
{a, a'} \<inter> arcs H = {}
a \<noteq> a'

goal (1 subgoal):
 1. card (arcs G) = 2 + card (arcs H)
[PROOF STEP]
by (auto simp: card_insert_if)


[STATEMENT]
lemma is_orthogonal_closure:
  assumes \<open>\<And>s. s \<in> S \<Longrightarrow> is_orthogonal a  s\<close>
  assumes \<open>x \<in> closure S\<close>
  shows \<open>is_orthogonal a x\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_orthogonal a x
[PROOF STEP]
by (metis assms(1) assms(2) orthogonal_complementI orthogonal_complement_of_closure orthogonal_complement_orthoI)


[STATEMENT]
lemma padic_one_simp:
  assumes "n >0"
  shows "padic_one p n =  \<one>\<^bsub>residue_ring (p^n)\<^esub>"
        "padic_one p n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. padic_one p n = \<one>\<^bsub>residue_ring (p ^ n)\<^esub> &&& padic_one p n = 1
[PROOF STEP]
apply (simp add: assms padic_one_def residue_ring_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. padic_one p n = 1
[PROOF STEP]
using assms padic_one_def
[PROOF STATE]
proof (prove)
using this:
0 < n
padic_one ?p \<equiv> \<lambda>n. if n = 0 then 0 else 1

goal (1 subgoal):
 1. padic_one p n = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma diagonal_to_Smith_PQ_JNF_canceled_first:
  "\<exists>Rep Abs. type_definition Rep Abs {0..<int n} \<Longrightarrow> {0..<int m} \<noteq> {} \<Longrightarrow>
  1 < m \<Longrightarrow> 1 < n \<Longrightarrow> isDiagonal_mat A \<Longrightarrow> is_bezout_ext bezout \<Longrightarrow>
  A \<in> carrier_mat m n \<Longrightarrow> (P, S, Q) = diagonal_to_Smith_PQ_JNF A bezout \<Longrightarrow>
  S = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> Smith_normal_form_mat S
  \<and> P \<in> carrier_mat m m \<and> S \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>Rep Abs. type_definition Rep Abs {0..<int n}; {0..<int m} \<noteq> {}; 1 < m; 1 < n; isDiagonal_mat A; is_bezout_ext bezout; A \<in> carrier_mat m n; (P, S, Q) = diagonal_to_Smith_PQ_JNF A bezout\<rbrakk> \<Longrightarrow> S = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> Smith_normal_form_mat S \<and> P \<in> carrier_mat m m \<and> S \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n
[PROOF STEP]
using diagonal_to_Smith_PQ_JNF_local_typedef[cancel_type_definition]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{0..<int ?m} \<noteq> {}; \<exists>Rep Abs. type_definition Rep Abs {0..<int ?n}; 1 < ?m; 1 < ?n; isDiagonal_mat ?A; is_bezout_ext ?bezout; ?A \<in> carrier_mat ?m ?n; (?P, ?S, ?Q) = diagonal_to_Smith_PQ_JNF ?A ?bezout\<rbrakk> \<Longrightarrow> ?S = ?P * ?A * ?Q \<and> invertible_mat ?P \<and> invertible_mat ?Q \<and> Smith_normal_form_mat ?S \<and> ?P \<in> carrier_mat ?m ?m \<and> ?S \<in> carrier_mat ?m ?n \<and> ?Q \<in> carrier_mat ?n ?n

goal (1 subgoal):
 1. \<lbrakk>\<exists>Rep Abs. type_definition Rep Abs {0..<int n}; {0..<int m} \<noteq> {}; 1 < m; 1 < n; isDiagonal_mat A; is_bezout_ext bezout; A \<in> carrier_mat m n; (P, S, Q) = diagonal_to_Smith_PQ_JNF A bezout\<rbrakk> \<Longrightarrow> S = P * A * Q \<and> invertible_mat P \<and> invertible_mat Q \<and> Smith_normal_form_mat S \<and> P \<in> carrier_mat m m \<and> S \<in> carrier_mat m n \<and> Q \<in> carrier_mat n n
[PROOF STEP]
by blast


[STATEMENT]
lemma (in ring) indexed_padd_zero:
  assumes "carrier_coeff P" shows "P \<Oplus> (indexed_const \<zero>) = P" and "(indexed_const \<zero>) \<Oplus> P = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<Oplus> indexed_const \<zero> = P &&& indexed_const \<zero> \<Oplus> P = P
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
carrier_coeff P

goal (1 subgoal):
 1. P \<Oplus> indexed_const \<zero> = P &&& indexed_const \<zero> \<Oplus> P = P
[PROOF STEP]
unfolding carrier_coeff_def indexed_zero_def indexed_padd_def
[PROOF STATE]
proof (prove)
using this:
\<forall>m. P m \<in> carrier R

goal (1 subgoal):
 1. (\<lambda>m. P m \<oplus> \<zero>) = P &&& (\<lambda>m. \<zero> \<oplus> P m) = P
[PROOF STEP]
by auto


[STATEMENT]
lemma Gen_Shleg_n_0 [simp]: "Gen_Shleg n 0 = fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.Gen_Shleg n 0 = fact n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.Gen_Shleg n 0 = fact n
[PROOF STEP]
have "Gen_Shleg n 0 = (\<Sum>i\<le>n. (-1) ^ (n-i) * real (n choose i) *
        (real (pochhammer (Suc (n-i)) i) *
         real (pochhammer (Suc i) (n-i))) * 0 ^ (n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.Gen_Shleg n 0 = (\<Sum>i\<le>n. (- 1) ^ (n - i) * real (n choose i) * (real (pochhammer (Suc (n - i)) i) * real (pochhammer (Suc i) (n - i))) * 0 ^ (n - i))
[PROOF STEP]
by (simp add: Gen_Shleg_altdef)
[PROOF STATE]
proof (state)
this:
local.Gen_Shleg n 0 = (\<Sum>i\<le>n. (- 1) ^ (n - i) * real (n choose i) * (real (pochhammer (Suc (n - i)) i) * real (pochhammer (Suc i) (n - i))) * 0 ^ (n - i))

goal (1 subgoal):
 1. local.Gen_Shleg n 0 = fact n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.Gen_Shleg n 0 = (\<Sum>i\<le>n. (- 1) ^ (n - i) * real (n choose i) * (real (pochhammer (Suc (n - i)) i) * real (pochhammer (Suc i) (n - i))) * 0 ^ (n - i))

goal (1 subgoal):
 1. local.Gen_Shleg n 0 = fact n
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>{n}. (-1) ^ (n-i) * real (n choose i) *
        (real (pochhammer (Suc (n-i)) i) *
         real (pochhammer (Suc i) (n-i))) * 0 ^ (n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. (- 1) ^ (n - i) * real (n choose i) * (real (pochhammer (Suc (n - i)) i) * real (pochhammer (Suc i) (n - i))) * 0 ^ (n - i)) = (\<Sum>i\<in>{n}. (- 1) ^ (n - i) * real (n choose i) * (real (pochhammer (Suc (n - i)) i) * real (pochhammer (Suc i) (n - i))) * 0 ^ (n - i))
[PROOF STEP]
by (intro sum.mono_neutral_right) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. (- 1) ^ (n - i) * real (n choose i) * (real (pochhammer (Suc (n - i)) i) * real (pochhammer (Suc i) (n - i))) * 0 ^ (n - i)) = (\<Sum>i\<in>{n}. (- 1) ^ (n - i) * real (n choose i) * (real (pochhammer (Suc (n - i)) i) * real (pochhammer (Suc i) (n - i))) * 0 ^ (n - i))

goal (1 subgoal):
 1. local.Gen_Shleg n 0 = fact n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. (- 1) ^ (n - i) * real (n choose i) * (real (pochhammer (Suc (n - i)) i) * real (pochhammer (Suc i) (n - i))) * 0 ^ (n - i)) = (\<Sum>i\<in>{n}. (- 1) ^ (n - i) * real (n choose i) * (real (pochhammer (Suc (n - i)) i) * real (pochhammer (Suc i) (n - i))) * 0 ^ (n - i))

goal (1 subgoal):
 1. local.Gen_Shleg n 0 = fact n
[PROOF STEP]
have "\<dots> = fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{n}. (- 1) ^ (n - i) * real (n choose i) * (real (pochhammer (Suc (n - i)) i) * real (pochhammer (Suc i) (n - i))) * 0 ^ (n - i)) = fact n
[PROOF STEP]
by (simp add: pochhammer_fact flip: pochhammer_of_nat)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{n}. (- 1) ^ (n - i) * real (n choose i) * (real (pochhammer (Suc (n - i)) i) * real (pochhammer (Suc i) (n - i))) * 0 ^ (n - i)) = fact n

goal (1 subgoal):
 1. local.Gen_Shleg n 0 = fact n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.Gen_Shleg n 0 = fact n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.Gen_Shleg n 0 = fact n

goal (1 subgoal):
 1. local.Gen_Shleg n 0 = fact n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.Gen_Shleg n 0 = fact n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_ge_one_minus_x_over_n_power_n:
  assumes "x \<le> real n" "n > 0"
  shows "(1 - x / of_nat n) ^ n \<le> exp (-x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - x / real n) ^ n \<le> exp (- x)
[PROOF STEP]
using exp_ge_one_plus_x_over_n_power_n[of n "-x"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- real n \<le> - x; 0 < n\<rbrakk> \<Longrightarrow> (1 + - x / real n) ^ n \<le> exp (- x)
x \<le> real n
0 < n

goal (1 subgoal):
 1. (1 - x / real n) ^ n \<le> exp (- x)
[PROOF STEP]
by simp


[STATEMENT]
lemma bernpoly_altdef:
  "bernpoly n = (\<lambda>x. \<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernpoly n = (\<lambda>x. \<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)
[PROOF STEP]
fix x :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)
[PROOF STEP]
have "bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose (n - k)) *
          of_real (bernoulli (n - k)) * x ^ (n - (n - k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose (n - k)) * of_real (bernoulli (n - k)) * x ^ (n - (n - k)))
[PROOF STEP]
unfolding bernpoly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli k) * x ^ (n - k)) = (\<Sum>k\<le>n. of_nat (n choose (n - k)) * of_real (bernoulli (n - k)) * x ^ (n - (n - k)))
[PROOF STEP]
by (rule sum.reindex_bij_witness[of _ "\<lambda>k. n - k" "\<lambda>k. n - k"]) simp_all
[PROOF STATE]
proof (state)
this:
bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose (n - k)) * of_real (bernoulli (n - k)) * x ^ (n - (n - k)))

goal (1 subgoal):
 1. \<And>x. bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose (n - k)) * of_real (bernoulli (n - k)) * x ^ (n - (n - k)))

goal (1 subgoal):
 1. \<And>x. bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)
[PROOF STEP]
have "\<dots> = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. of_nat (n choose (n - k)) * of_real (bernoulli (n - k)) * x ^ (n - (n - k))) = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)
[PROOF STEP]
by (intro sum.cong refl) (simp_all add: binomial_symmetric [symmetric])
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. of_nat (n choose (n - k)) * of_real (bernoulli (n - k)) * x ^ (n - (n - k))) = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)

goal (1 subgoal):
 1. \<And>x. bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)
[PROOF STEP]
show "bernpoly n x = \<dots>"
[PROOF STATE]
proof (prove)
using this:
bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)

goal (1 subgoal):
 1. bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
bernpoly n x = (\<Sum>k\<le>n. of_nat (n choose k) * of_real (bernoulli (n - k)) * x ^ k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_plus_imp_minus: "a \<in> b +o C \<Longrightarrow> a - b \<in> C"
  for a b :: "'a::ab_group_add"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> b +o C \<Longrightarrow> a - b \<in> C
[PROOF STEP]
by (auto simp add: elt_set_plus_def ac_simps)


[STATEMENT]
lemma prefers_trans: "P \<turnstile> x < y \<Longrightarrow> P \<turnstile> y < z \<Longrightarrow> P \<turnstile> x < z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<turnstile> x < y; P \<turnstile> y < z\<rbrakk> \<Longrightarrow> P \<turnstile> x < z
[PROOF STEP]
by (meson order_less_trans prefers_def)


[STATEMENT]
lemma CONS_inj[Presb_simps]: "size x = #\<^sub>V \<AA> \<Longrightarrow> size y = #\<^sub>V \<AA> \<Longrightarrow> #\<^sub>V \<AA> = #\<^sub>V \<BB> \<Longrightarrow>
  CONS x \<AA> = CONS y \<BB> \<longleftrightarrow> (x = y \<and> \<AA> = \<BB>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length x = #\<^sub>V \<AA>; length y = #\<^sub>V \<AA>; #\<^sub>V \<AA> = #\<^sub>V \<BB>\<rbrakk> \<Longrightarrow> (CONS x \<AA> = CONS y \<BB>) = (x = y \<and> \<AA> = \<BB>)
[PROOF STEP]
by transfer (auto simp: list_eq_iff_nth_eq odd_neq_even split: if_splits)


[STATEMENT]
lemma all_lt_Suc:
"(\<forall> i < Suc n. phi i) = ((\<forall> i < n. phi i) \<and> phi n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i<Suc n. phi i) = ((\<forall>i<n. phi i) \<and> phi n)
[PROOF STEP]
using less_Suc_eq
[PROOF STATE]
proof (prove)
using this:
(?m < Suc ?n) = (?m < ?n \<or> ?m = ?n)

goal (1 subgoal):
 1. (\<forall>i<Suc n. phi i) = ((\<forall>i<n. phi i) \<and> phi n)
[PROOF STEP]
by auto


[STATEMENT]
lemma qconv_comp: "qconv (c\<^sub>1 \<circ>\<^sub>C c\<^sub>2) x = qconv c\<^sub>1 (qconv c\<^sub>2 x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qconv (c\<^sub>1 \<circ>\<^sub>C c\<^sub>2) x = qconv c\<^sub>1 (qconv c\<^sub>2 x)
[PROOF STEP]
by (transfer, simp add: dconvfactor_compose of_rat_mult)


[STATEMENT]
lemma is_unit_mult_iff[simp]:
  shows "(a * b) dvd 1 \<longleftrightarrow> a dvd 1 \<and> b dvd 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * b dvd (1::'a)) = (a dvd (1::'a) \<and> b dvd (1::'a))
[PROOF STEP]
by (auto dest: dvd_mult_left dvd_mult_right)


[STATEMENT]
lemma differentiable_on_imp_piecewise_differentiable:
  fixes a:: "'a::{linorder_topology,real_normed_vector}"
  shows "f differentiable_on {a..b} \<Longrightarrow> f piecewise_differentiable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f differentiable_on {a..b} \<Longrightarrow> f piecewise_differentiable_on {a..b}
[PROOF STEP]
apply (simp add: piecewise_differentiable_on_def differentiable_imp_continuous_on)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f differentiable_on {a..b} \<Longrightarrow> \<exists>S. finite S \<and> (\<forall>x\<in>{a..b} - S. f differentiable at x within {a..b})
[PROOF STEP]
apply (rule_tac x="{a,b}" in exI, simp add: differentiable_on_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma In1_mono: "M<=N ==> In1(M) <= In1(N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<subseteq> N \<Longrightarrow> In1 M \<subseteq> In1 N
[PROOF STEP]
by (simp add: In1_def Scons_mono)


[STATEMENT]
lemma powser_continuous_suminf:
  fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
  assumes "r < conv_radius a"
  shows "continuous_on (cball \<xi> r) (\<lambda>x. suminf (\<lambda>i. a i * (x - \<xi>) ^ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cball \<xi> r) (\<lambda>x. \<Sum>i. a i * (x - \<xi>) ^ i)
[PROOF STEP]
apply (rule uniform_limit_theorem [OF _ powser_uniform_limit])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. continuous_on (cball \<xi> r) (\<lambda>x. \<Sum>i<n. a i * (x - \<xi>) ^ i)
 2. ereal r < conv_radius a
 3. sequentially \<noteq> bot
[PROOF STEP]
apply (rule eventuallyI continuous_intros assms)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sequentially \<noteq> bot
[PROOF STEP]
apply (simp add:)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma trace_hd: "hd (trace n f g xs x) = the (eval (Pr n f g) (x # xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (trace n f g xs x) = the (eval (Pr n f g) (x # xs))
[PROOF STEP]
using trace_def
[PROOF STATE]
proof (prove)
using this:
trace ?n ?f ?g ?xs ?x \<equiv> map (\<lambda>y. the (eval (Pr ?n ?f ?g) (y # ?xs))) (rev [0..<Suc ?x])

goal (1 subgoal):
 1. hd (trace n f g xs x) = the (eval (Pr n f g) (x # xs))
[PROOF STEP]
by simp


[STATEMENT]
theorem Crypt_Crypt_eq [iff]: "(Crypt K X = Crypt K X') = (X=X')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Crypt K X = Crypt K X') = (X = X')
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Crypt K X = Crypt K X' \<Longrightarrow> X = X'
 2. X = X' \<Longrightarrow> Crypt K X = Crypt K X'
[PROOF STEP]
assume "Crypt K X = Crypt K X'"
[PROOF STATE]
proof (state)
this:
Crypt K X = Crypt K X'

goal (2 subgoals):
 1. Crypt K X = Crypt K X' \<Longrightarrow> X = X'
 2. X = X' \<Longrightarrow> Crypt K X = Crypt K X'
[PROOF STEP]
hence "Decrypt K (Crypt K X) = Decrypt K (Crypt K X')"
[PROOF STATE]
proof (prove)
using this:
Crypt K X = Crypt K X'

goal (1 subgoal):
 1. Decrypt K (Crypt K X) = Decrypt K (Crypt K X')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Decrypt K (Crypt K X) = Decrypt K (Crypt K X')

goal (2 subgoals):
 1. Crypt K X = Crypt K X' \<Longrightarrow> X = X'
 2. X = X' \<Longrightarrow> Crypt K X = Crypt K X'
[PROOF STEP]
thus "X = X'"
[PROOF STATE]
proof (prove)
using this:
Decrypt K (Crypt K X) = Decrypt K (Crypt K X')

goal (1 subgoal):
 1. X = X'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X = X'

goal (1 subgoal):
 1. X = X' \<Longrightarrow> Crypt K X = Crypt K X'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X = X' \<Longrightarrow> Crypt K X = Crypt K X'
[PROOF STEP]
assume "X = X'"
[PROOF STATE]
proof (state)
this:
X = X'

goal (1 subgoal):
 1. X = X' \<Longrightarrow> Crypt K X = Crypt K X'
[PROOF STEP]
thus "Crypt K X = Crypt K X'"
[PROOF STATE]
proof (prove)
using this:
X = X'

goal (1 subgoal):
 1. Crypt K X = Crypt K X'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Crypt K X = Crypt K X'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma T_ge_half_k: "T \<ge> k div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k div 2 \<le> T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k div 2 \<le> T
[PROOF STEP]
have "k div 2 \<le> legendre_aux k 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k div 2 \<le> legendre_aux (real k) 2
[PROOF STEP]
using legendre_aux_ge[of 2 k] pos
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime 2; 1 \<le> real k\<rbrakk> \<Longrightarrow> nat \<lfloor>real k / real 2\<rfloor> \<le> legendre_aux (real k) 2
0 < k
0 < n

goal (1 subgoal):
 1. k div 2 \<le> legendre_aux (real k) 2
[PROOF STEP]
by simp linarith?
[PROOF STATE]
proof (state)
this:
k div 2 \<le> legendre_aux (real k) 2

goal (1 subgoal):
 1. k div 2 \<le> T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
k div 2 \<le> legendre_aux (real k) 2

goal (1 subgoal):
 1. k div 2 \<le> T
[PROOF STEP]
have "\<dots> = multiplicity 2 (fact k :: nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. legendre_aux (real k) 2 = multiplicity 2 (fact k)
[PROOF STEP]
by (simp add: multiplicity_prime_fact)
[PROOF STATE]
proof (state)
this:
legendre_aux (real k) 2 = multiplicity 2 (fact k)

goal (1 subgoal):
 1. k div 2 \<le> T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
legendre_aux (real k) 2 = multiplicity 2 (fact k)

goal (1 subgoal):
 1. k div 2 \<le> T
[PROOF STEP]
have "\<dots> = T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity 2 (fact k) = T
[PROOF STEP]
by (simp add: k_n)
[PROOF STATE]
proof (state)
this:
multiplicity 2 (fact k) = T

goal (1 subgoal):
 1. k div 2 \<le> T
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
k div 2 \<le> T
[PROOF STEP]
show "T \<ge> k div 2"
[PROOF STATE]
proof (prove)
using this:
k div 2 \<le> T

goal (1 subgoal):
 1. k div 2 \<le> T
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
k div 2 \<le> T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem se_star_mono_for_sub :
  assumes "se_star c1 ls c1'"
  assumes "se_star c2 ls c2'"
  assumes "c2  \<sqsubseteq> c1"
  shows   "c2' \<sqsubseteq> c1'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c2' \<sqsubseteq> c1'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
se_star c1 ls c1'
se_star c2 ls c2'
c2 \<sqsubseteq> c1

goal (1 subgoal):
 1. c2' \<sqsubseteq> c1'
[PROOF STEP]
by (induct ls arbitrary : c1 c2)
   (auto simp add :  se_star_Cons se_mono_for_sub)


[STATEMENT]
lemma cindex_poly_noroot:
  assumes "a<b" "\<forall>x. a<x \<and> x<b \<longrightarrow> poly p x\<noteq>0"
  shows "cindex_poly a b q p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_poly a b q p = 0
[PROOF STEP]
unfolding cindex_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | poly p x = 0 \<and> a < x \<and> x < b. jump_poly q p x) = 0
[PROOF STEP]
apply (rule sum.neutral)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{x. poly p x = 0 \<and> a < x \<and> x < b}. jump_poly q p x = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < b
\<forall>x. a < x \<and> x < b \<longrightarrow> poly p x \<noteq> 0

goal (1 subgoal):
 1. \<forall>x\<in>{x. poly p x = 0 \<and> a < x \<and> x < b}. jump_poly q p x = 0
[PROOF STEP]
by (auto intro:jump_poly_not_root)


[STATEMENT]
lemma tagged_partial_division_of_Union_self:
  assumes "p tagged_partial_division_of s"
  shows "p tagged_division_of (\<Union>(snd ` p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p tagged_division_of \<Union> (snd ` p)
[PROOF STEP]
apply (rule tagged_division_ofI)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. finite p
 2. \<And>x K. (x, K) \<in> p \<Longrightarrow> x \<in> K
 3. \<And>x K. (x, K) \<in> p \<Longrightarrow> K \<subseteq> \<Union> (snd ` p)
 4. \<And>x K. (x, K) \<in> p \<Longrightarrow> \<exists>a b. K = cbox a b
 5. \<And>x1 K1 x2 K2. \<lbrakk>(x1, K1) \<in> p; (x2, K2) \<in> p; (x1, K1) \<noteq> (x2, K2)\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
 6. \<Union> {K. \<exists>x. (x, K) \<in> p} = \<Union> (snd ` p)
[PROOF STEP]
using tagged_partial_division_ofD[OF assms]
[PROOF STATE]
proof (prove)
using this:
finite p
(?x, ?K) \<in> p \<Longrightarrow> ?x \<in> ?K
(?x, ?K) \<in> p \<Longrightarrow> ?K \<subseteq> s
(?x, ?K) \<in> p \<Longrightarrow> \<exists>a b. ?K = cbox a b
\<lbrakk>(?x1.0, ?K1.0) \<in> p; (?x2.0, ?K2.0) \<in> p; (?x1.0, ?K1.0) \<noteq> (?x2.0, ?K2.0)\<rbrakk> \<Longrightarrow> interior ?K1.0 \<inter> interior ?K2.0 = {}

goal (6 subgoals):
 1. finite p
 2. \<And>x K. (x, K) \<in> p \<Longrightarrow> x \<in> K
 3. \<And>x K. (x, K) \<in> p \<Longrightarrow> K \<subseteq> \<Union> (snd ` p)
 4. \<And>x K. (x, K) \<in> p \<Longrightarrow> \<exists>a b. K = cbox a b
 5. \<And>x1 K1 x2 K2. \<lbrakk>(x1, K1) \<in> p; (x2, K2) \<in> p; (x1, K1) \<noteq> (x2, K2)\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
 6. \<Union> {K. \<exists>x. (x, K) \<in> p} = \<Union> (snd ` p)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma combine_append_zero:
  "set Us \<subseteq> carrier R \<Longrightarrow> combine (Ks @ [ \<zero> ]) Us = combine Ks Us"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set Us \<subseteq> carrier R \<Longrightarrow> combine (Ks @ [\<zero>]) Us = combine Ks Us
[PROOF STEP]
proof (induct Ks arbitrary: Us)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>Us. set Us \<subseteq> carrier R \<Longrightarrow> combine ([] @ [\<zero>]) Us = combine [] Us
 2. \<And>a Ks Us. \<lbrakk>\<And>Us. set Us \<subseteq> carrier R \<Longrightarrow> combine (Ks @ [\<zero>]) Us = combine Ks Us; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine ((a # Ks) @ [\<zero>]) Us = combine (a # Ks) Us
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
set Us \<subseteq> carrier R

goal (2 subgoals):
 1. \<And>Us. set Us \<subseteq> carrier R \<Longrightarrow> combine ([] @ [\<zero>]) Us = combine [] Us
 2. \<And>a Ks Us. \<lbrakk>\<And>Us. set Us \<subseteq> carrier R \<Longrightarrow> combine (Ks @ [\<zero>]) Us = combine Ks Us; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine ((a # Ks) @ [\<zero>]) Us = combine (a # Ks) Us
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
set Us \<subseteq> carrier R

goal (1 subgoal):
 1. combine ([] @ [\<zero>]) Us = combine [] Us
[PROOF STEP]
by (induct Us) (auto)
[PROOF STATE]
proof (state)
this:
combine ([] @ [\<zero>]) Us = combine [] Us

goal (1 subgoal):
 1. \<And>a Ks Us. \<lbrakk>\<And>Us. set Us \<subseteq> carrier R \<Longrightarrow> combine (Ks @ [\<zero>]) Us = combine Ks Us; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine ((a # Ks) @ [\<zero>]) Us = combine (a # Ks) Us
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a Ks Us. \<lbrakk>\<And>Us. set Us \<subseteq> carrier R \<Longrightarrow> combine (Ks @ [\<zero>]) Us = combine Ks Us; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine ((a # Ks) @ [\<zero>]) Us = combine (a # Ks) Us
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
set ?Us \<subseteq> carrier R \<Longrightarrow> combine (Ks_ @ [\<zero>]) ?Us = combine Ks_ ?Us
set Us \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>a Ks Us. \<lbrakk>\<And>Us. set Us \<subseteq> carrier R \<Longrightarrow> combine (Ks @ [\<zero>]) Us = combine Ks Us; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine ((a # Ks) @ [\<zero>]) Us = combine (a # Ks) Us
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
set ?Us \<subseteq> carrier R \<Longrightarrow> combine (Ks_ @ [\<zero>]) ?Us = combine Ks_ ?Us
set Us \<subseteq> carrier R

goal (1 subgoal):
 1. combine ((a_ # Ks_) @ [\<zero>]) Us = combine (a_ # Ks_) Us
[PROOF STEP]
by (cases Us) (auto)
[PROOF STATE]
proof (state)
this:
combine ((a_ # Ks_) @ [\<zero>]) Us = combine (a_ # Ks_) Us

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_comparison:
  assumes "summable f" and gf: "\<And>n. norm (g n) \<le> f n"
  shows "suminf g \<le> suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suminf g \<le> suminf f
[PROOF STEP]
proof (rule suminf_le)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. g n \<le> f n
 2. summable g
 3. summable f
[PROOF STEP]
show "g n \<le> f n" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g n \<le> f n
[PROOF STEP]
using gf[of n]
[PROOF STATE]
proof (prove)
using this:
norm (g n) \<le> f n

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

goal (2 subgoals):
 1. summable g
 2. summable f
[PROOF STEP]
show "summable g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable g
[PROOF STEP]
using assms summable_comparison_test'
[PROOF STATE]
proof (prove)
using this:
summable f
norm (g ?n) \<le> f ?n
\<lbrakk>summable ?g; \<And>n. ?N \<le> n \<Longrightarrow> norm (?f n) \<le> ?g n\<rbrakk> \<Longrightarrow> summable ?f

goal (1 subgoal):
 1. summable g
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
summable g

goal (1 subgoal):
 1. summable f
[PROOF STEP]
show "summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
summable f

goal (1 subgoal):
 1. summable f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
summable f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_tensor_prod_2 [simp]:
  assumes "v \<in> state_qbit 1" and "w \<in> state_qbit 1"
  shows "v \<otimes> w = vec_of_list [v $ 0 * w $ 0, v $ 0 * w $ 1, v $ 1 * w $ 0, v $ 1 * w $ 1]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<otimes> w = vec_of_list [v $ 0 * w $ 0, v $ 0 * w $ 1, v $ 1 * w $ 0, v $ 1 * w $ 1]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<otimes> w = vec_of_list [v $ 0 * w $ 0, v $ 0 * w $ 1, v $ 1 * w $ 0, v $ 1 * w $ 1]
[PROOF STEP]
have "list_of_vec v = [v $ 0, v $ 1]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of_vec v = [v $ 0, v $ 1]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> state_qbit 1
w \<in> state_qbit 1

goal (1 subgoal):
 1. list_of_vec v = [v $ 0, v $ 1]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
list_of_vec v = [v $ 0, v $ 1]

goal (1 subgoal):
 1. v \<otimes> w = vec_of_list [v $ 0 * w $ 0, v $ 0 * w $ 1, v $ 1 * w $ 0, v $ 1 * w $ 1]
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
list_of_vec v = [v $ 0, v $ 1]

goal (1 subgoal):
 1. v \<otimes> w = vec_of_list [v $ 0 * w $ 0, v $ 0 * w $ 1, v $ 1 * w $ 0, v $ 1 * w $ 1]
[PROOF STEP]
have "list_of_vec w = [w $ 0, w $ 1]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of_vec w = [w $ 0, w $ 1]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> state_qbit 1
w \<in> state_qbit 1

goal (1 subgoal):
 1. list_of_vec w = [w $ 0, w $ 1]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
list_of_vec w = [w $ 0, w $ 1]

goal (1 subgoal):
 1. v \<otimes> w = vec_of_list [v $ 0 * w $ 0, v $ 0 * w $ 1, v $ 1 * w $ 0, v $ 1 * w $ 1]
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
list_of_vec v = [v $ 0, v $ 1]
list_of_vec w = [w $ 0, w $ 1]
[PROOF STEP]
show "v \<otimes> w = vec_of_list [v $ 0 * w $ 0, v $ 0 * w $ 1, v $ 1 * w $ 0, v $ 1 * w $ 1]"
[PROOF STATE]
proof (prove)
using this:
list_of_vec v = [v $ 0, v $ 1]
list_of_vec w = [w $ 0, w $ 1]

goal (1 subgoal):
 1. v \<otimes> w = vec_of_list [v $ 0 * w $ 0, v $ 0 * w $ 1, v $ 1 * w $ 0, v $ 1 * w $ 1]
[PROOF STEP]
by(simp add: tensor_vec_def)
[PROOF STATE]
proof (state)
this:
v \<otimes> w = vec_of_list [v $ 0 * w $ 0, v $ 0 * w $ 1, v $ 1 * w $ 0, v $ 1 * w $ 1]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nall_tuplesD: "vs \<in> nall_tuples AD n \<Longrightarrow>
  length vs = n \<and> set vs \<subseteq> Inl ` AD \<union> Inr ` {..<n} \<and> fo_nmlzd AD vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs \<in> nall_tuples AD n \<Longrightarrow> length vs = n \<and> set vs \<subseteq> Inl ` AD \<union> Inr ` {..<n} \<and> fo_nmlzd AD vs
[PROOF STEP]
by (auto simp: nall_tuples_def dest: all_tuplesD)


[STATEMENT]
theorem "((A \<longrightarrow> B) \<longrightarrow> A) \<longrightarrow> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((A \<longrightarrow> B) \<longrightarrow> A) \<longrightarrow> A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A \<longrightarrow> B) \<longrightarrow> A \<Longrightarrow> A
[PROOF STEP]
assume "(A \<longrightarrow> B) \<longrightarrow> A"
[PROOF STATE]
proof (state)
this:
(A \<longrightarrow> B) \<longrightarrow> A

goal (1 subgoal):
 1. (A \<longrightarrow> B) \<longrightarrow> A \<Longrightarrow> A
[PROOF STEP]
show A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A
[PROOF STEP]
proof (rule classical)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> A \<Longrightarrow> A
[PROOF STEP]
presume "A \<longrightarrow> B"
[PROOF STATE]
proof (state)
this:
A \<longrightarrow> B

goal (1 subgoal):
 1. \<not> A \<Longrightarrow> A
[PROOF STEP]
with \<open>(A \<longrightarrow> B) \<longrightarrow> A\<close>
[PROOF STATE]
proof (chain)
picking this:
(A \<longrightarrow> B) \<longrightarrow> A
A \<longrightarrow> B
[PROOF STEP]
show A
[PROOF STATE]
proof (prove)
using this:
(A \<longrightarrow> B) \<longrightarrow> A
A \<longrightarrow> B

goal (1 subgoal):
 1. A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A

goal (1 subgoal):
 1. \<not> A \<Longrightarrow> A \<longrightarrow> B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> A \<Longrightarrow> A \<longrightarrow> B
[PROOF STEP]
assume "\<not> A"
[PROOF STATE]
proof (state)
this:
\<not> A

goal (1 subgoal):
 1. \<not> A \<Longrightarrow> A \<longrightarrow> B
[PROOF STEP]
show "A \<longrightarrow> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<longrightarrow> B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<Longrightarrow> B
[PROOF STEP]
assume A
[PROOF STATE]
proof (state)
this:
A

goal (1 subgoal):
 1. A \<Longrightarrow> B
[PROOF STEP]
with \<open>\<not> A\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> A
A
[PROOF STEP]
show B
[PROOF STATE]
proof (prove)
using this:
\<not> A
A

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A \<longrightarrow> B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma upper_asymptotic_density_union:
  "upper_asymptotic_density (A \<union> B) \<le> upper_asymptotic_density A + upper_asymptotic_density B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> upper_asymptotic_density A + upper_asymptotic_density B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> upper_asymptotic_density A + upper_asymptotic_density B
[PROOF STEP]
have "upper_asymptotic_density (A \<union> B) \<le> l" if H: "l > upper_asymptotic_density A + upper_asymptotic_density B" for l
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
obtain lA lB where l: "l = lA+lB" and lA: "lA > upper_asymptotic_density A" and lB: "lB > upper_asymptotic_density B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>lA lB. \<lbrakk>l = lA + lB; upper_asymptotic_density A < lA; upper_asymptotic_density B < lB\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lem_ge_sum H
[PROOF STATE]
proof (prove)
using this:
?x + ?y < ?l \<Longrightarrow> \<exists>lx ly. ?l = lx + ly \<and> ?x < lx \<and> ?y < ly
upper_asymptotic_density A + upper_asymptotic_density B < l

goal (1 subgoal):
 1. (\<And>lA lB. \<lbrakk>l = lA + lB; upper_asymptotic_density A < lA; upper_asymptotic_density B < lB\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
l = lA + lB
upper_asymptotic_density A < lA
upper_asymptotic_density B < lB

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
l = lA + lB
upper_asymptotic_density A < lA
upper_asymptotic_density B < lB

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
assume H: "card (A \<inter> {..<n}) < lA * n \<and> card (B \<inter> {..<n}) < lB * n"
[PROOF STATE]
proof (state)
this:
real (card (A \<inter> {..<n})) < lA * real n \<and> real (card (B \<inter> {..<n})) < lB * real n

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
have "card((A\<union>B) \<inter> {..<n}) \<le> card(A \<inter> {..<n}) + card(B \<inter> {..<n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((A \<union> B) \<inter> {..<n}) \<le> card (A \<inter> {..<n}) + card (B \<inter> {..<n})
[PROOF STEP]
by (simp add: card_Un_le inf_sup_distrib2)
[PROOF STATE]
proof (state)
this:
card ((A \<union> B) \<inter> {..<n}) \<le> card (A \<inter> {..<n}) + card (B \<inter> {..<n})

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card ((A \<union> B) \<inter> {..<n}) \<le> card (A \<inter> {..<n}) + card (B \<inter> {..<n})

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
have "... \<le> l * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (A \<inter> {..<n}) + card (B \<inter> {..<n})) \<le> l * real n
[PROOF STEP]
using l H
[PROOF STATE]
proof (prove)
using this:
l = lA + lB
real (card (A \<inter> {..<n})) < lA * real n \<and> real (card (B \<inter> {..<n})) < lB * real n

goal (1 subgoal):
 1. real (card (A \<inter> {..<n}) + card (B \<inter> {..<n})) \<le> l * real n
[PROOF STEP]
by (simp add: ring_class.ring_distribs(2))
[PROOF STATE]
proof (state)
this:
real (card (A \<inter> {..<n}) + card (B \<inter> {..<n})) \<le> l * real n

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> real x \<le> real y) \<Longrightarrow> real (card ((A \<union> B) \<inter> {..<n})) \<le> l * real n
[PROOF STEP]
have "card ((A\<union>B) \<inter> {..<n}) \<le> l * n"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> real x \<le> real y) \<Longrightarrow> real (card ((A \<union> B) \<inter> {..<n})) \<le> l * real n

goal (1 subgoal):
 1. real (card ((A \<union> B) \<inter> {..<n})) \<le> l * real n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (card ((A \<union> B) \<inter> {..<n})) \<le> l * real n

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
real (card (A \<inter> {..<?n2})) < lA * real ?n2 \<and> real (card (B \<inter> {..<?n2})) < lB * real ?n2 \<Longrightarrow> real (card ((A \<union> B) \<inter> {..<?n2})) \<le> l * real ?n2

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real (card (A \<inter> {..<?n2})) < lA * real ?n2 \<and> real (card (B \<inter> {..<?n2})) < lB * real ?n2 \<Longrightarrow> real (card ((A \<union> B) \<inter> {..<?n2})) \<le> l * real ?n2

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
have "eventually (\<lambda>n. card (A \<inter> {..<n}) < lA * n \<and> card (B \<inter> {..<n}) < lB * n) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real (card (A \<inter> {..<n})) < lA * real n \<and> real (card (B \<inter> {..<n})) < lB * real n
[PROOF STEP]
using upper_asymptotic_densityD[OF lA] upper_asymptotic_densityD[OF lB] eventually_conj
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. real (card (A \<inter> {..<n})) < lA * real n
\<forall>\<^sub>F n in sequentially. real (card (B \<inter> {..<n})) < lB * real n
\<lbrakk>eventually ?P ?F; eventually ?Q ?F\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in ?F. ?P x \<and> ?Q x

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real (card (A \<inter> {..<n})) < lA * real n \<and> real (card (B \<inter> {..<n})) < lB * real n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real (card (A \<inter> {..<n})) < lA * real n \<and> real (card (B \<inter> {..<n})) < lB * real n

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real (card (A \<inter> {..<?n2})) < lA * real ?n2 \<and> real (card (B \<inter> {..<?n2})) < lB * real ?n2 \<Longrightarrow> real (card ((A \<union> B) \<inter> {..<?n2})) \<le> l * real ?n2
\<forall>\<^sub>F n in sequentially. real (card (A \<inter> {..<n})) < lA * real n \<and> real (card (B \<inter> {..<n})) < lB * real n
[PROOF STEP]
have "eventually (\<lambda>n. card((A\<union>B) \<inter> {..<n}) \<le> l * n) sequentially"
[PROOF STATE]
proof (prove)
using this:
real (card (A \<inter> {..<?n2})) < lA * real ?n2 \<and> real (card (B \<inter> {..<?n2})) < lB * real ?n2 \<Longrightarrow> real (card ((A \<union> B) \<inter> {..<?n2})) \<le> l * real ?n2
\<forall>\<^sub>F n in sequentially. real (card (A \<inter> {..<n})) < lA * real n \<and> real (card (B \<inter> {..<n})) < lB * real n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real (card ((A \<union> B) \<inter> {..<n})) \<le> l * real n
[PROOF STEP]
by (simp add: eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real (card ((A \<union> B) \<inter> {..<n})) \<le> l * real n

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. real (card ((A \<union> B) \<inter> {..<n})) \<le> l * real n
[PROOF STEP]
show "upper_asymptotic_density (A \<union> B) \<le> l"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. real (card ((A \<union> B) \<inter> {..<n})) \<le> l * real n

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
using upper_asymptotic_densityI
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. real (card ((A \<union> B) \<inter> {..<n})) \<le> l * real n
\<forall>\<^sub>F n in sequentially. real (card (?A \<inter> {..<n})) \<le> ?l * real n \<Longrightarrow> upper_asymptotic_density ?A \<le> ?l

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
upper_asymptotic_density (A \<union> B) \<le> l

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
upper_asymptotic_density A + upper_asymptotic_density B < ?l \<Longrightarrow> upper_asymptotic_density (A \<union> B) \<le> ?l

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> upper_asymptotic_density A + upper_asymptotic_density B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
upper_asymptotic_density A + upper_asymptotic_density B < ?l \<Longrightarrow> upper_asymptotic_density (A \<union> B) \<le> ?l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
upper_asymptotic_density A + upper_asymptotic_density B < ?l \<Longrightarrow> upper_asymptotic_density (A \<union> B) \<le> ?l

goal (1 subgoal):
 1. upper_asymptotic_density (A \<union> B) \<le> upper_asymptotic_density A + upper_asymptotic_density B
[PROOF STEP]
by (meson dense not_le)
[PROOF STATE]
proof (state)
this:
upper_asymptotic_density (A \<union> B) \<le> upper_asymptotic_density A + upper_asymptotic_density B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_1:
assumes I: "finite I" and ss: "sum f I = 1" and i: "i \<in> I - I1" and I1: "I1 \<subseteq> I"
and f: "\<And>i. i \<in> I \<Longrightarrow> (0::real) \<le> f i"
shows "f i \<le> 1 - sum f I1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f i \<le> 1 - sum f I1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f i \<le> 1 - sum f I1
[PROOF STEP]
have "sum f I = sum f ({i} Un (I - {i}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f I = sum f ({i} \<union> (I - {i}))
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i \<in> I - I1

goal (1 subgoal):
 1. sum f I = sum f ({i} \<union> (I - {i}))
[PROOF STEP]
by (metis DiffE insert_Diff_single insert_absorb insert_is_Un)
[PROOF STATE]
proof (state)
this:
sum f I = sum f ({i} \<union> (I - {i}))

goal (1 subgoal):
 1. f i \<le> 1 - sum f I1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f I = sum f ({i} \<union> (I - {i}))

goal (1 subgoal):
 1. f i \<le> 1 - sum f I1
[PROOF STEP]
have "... = sum f {i} + sum f (I - {i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f ({i} \<union> (I - {i})) = sum f {i} + sum f (I - {i})
[PROOF STEP]
apply(rule sum.union_disjoint)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {i}
 2. finite (I - {i})
 3. {i} \<inter> (I - {i}) = {}
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
finite I

goal (3 subgoals):
 1. finite {i}
 2. finite (I - {i})
 3. {i} \<inter> (I - {i}) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum f ({i} \<union> (I - {i})) = sum f {i} + sum f (I - {i})

goal (1 subgoal):
 1. f i \<le> 1 - sum f I1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum f I = sum f {i} + sum f (I - {i})
[PROOF STEP]
have "1 = f i + sum f (I - {i})"
[PROOF STATE]
proof (prove)
using this:
sum f I = sum f {i} + sum f (I - {i})

goal (1 subgoal):
 1. 1 = f i + sum f (I - {i})
[PROOF STEP]
unfolding ss[THEN sym]
[PROOF STATE]
proof (prove)
using this:
sum f I = sum f {i} + sum f (I - {i})

goal (1 subgoal):
 1. sum f I = f i + sum f (I - {i})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 = f i + sum f (I - {i})

goal (1 subgoal):
 1. f i \<le> 1 - sum f I1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 = f i + sum f (I - {i})

goal (1 subgoal):
 1. f i \<le> 1 - sum f I1
[PROOF STEP]
have "sum f (I - {i}) \<ge> sum f I1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f I1 \<le> sum f (I - {i})
[PROOF STEP]
apply(rule sum_mono2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite (I - {i})
 2. I1 \<subseteq> I - {i}
 3. \<And>b. b \<in> I - {i} - I1 \<Longrightarrow> 0 \<le> f b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
sum f I = 1
i \<in> I - I1
I1 \<subseteq> I
?i \<in> I \<Longrightarrow> 0 \<le> f ?i

goal (3 subgoals):
 1. finite (I - {i})
 2. I1 \<subseteq> I - {i}
 3. \<And>b. b \<in> I - {i} - I1 \<Longrightarrow> 0 \<le> f b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum f I1 \<le> sum f (I - {i})

goal (1 subgoal):
 1. f i \<le> 1 - sum f I1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 = f i + sum f (I - {i})
sum f I1 \<le> sum f (I - {i})
[PROOF STEP]
have "1 \<ge> f i + sum f I1"
[PROOF STATE]
proof (prove)
using this:
1 = f i + sum f (I - {i})
sum f I1 \<le> sum f (I - {i})

goal (1 subgoal):
 1. f i + sum f I1 \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f i + sum f I1 \<le> 1

goal (1 subgoal):
 1. f i \<le> 1 - sum f I1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f i + sum f I1 \<le> 1

goal (1 subgoal):
 1. f i \<le> 1 - sum f I1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f i \<le> 1 - sum f I1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_times_vec_leqD[dest]:
  assumes "[A *\<^sub>v x]\<le>b"
  shows "dim_row A = dim_vec b" "dim_col A = dim_vec x" "\<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x)$i \<le> b$i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row A = dim_vec b &&& dim_col A = dim_vec x &&& (\<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i)
[PROOF STEP]
using assms mat_times_vec_leq_def
[PROOF STATE]
proof (prove)
using this:
[A*\<^sub>vx]\<le>b
[?A*\<^sub>v?x]\<le>?b = ((\<forall>i<dim_vec ?b. (?A *\<^sub>v ?x) $ i \<le> ?b $ i) \<and> dim_row ?A = dim_vec ?b \<and> dim_col ?A = dim_vec ?x)

goal (1 subgoal):
 1. dim_row A = dim_vec b &&& dim_col A = dim_vec x &&& (\<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i)
[PROOF STEP]
by blast+


[STATEMENT]
lemma coeff_range:
  assumes "subring K R"
  assumes "f \<in> carrier (K[X])"
  shows "coeff f i \<in> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff f i \<in> K
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.coeff f i \<in> K
[PROOF STEP]
have "coeff f i \<in> set f \<union> {\<zero>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff f i \<in> set f \<union> {\<zero>}
[PROOF STEP]
using coeff_img(3)
[PROOF STATE]
proof (prove)
using this:
range (local.coeff ?p) = set ?p \<union> {\<zero>}

goal (1 subgoal):
 1. local.coeff f i \<in> set f \<union> {\<zero>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.coeff f i \<in> set f \<union> {\<zero>}

goal (1 subgoal):
 1. local.coeff f i \<in> K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.coeff f i \<in> set f \<union> {\<zero>}

goal (1 subgoal):
 1. local.coeff f i \<in> K
[PROOF STEP]
have "... \<subseteq> K \<union> {\<zero>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set f \<union> {\<zero>} \<subseteq> K \<union> {\<zero>}
[PROOF STEP]
using assms(2) univ_poly_carrier polynomial_incl
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (K [X])
polynomial\<^bsub>?R\<^esub> ?K ?p = (?p \<in> carrier (?K [X]\<^bsub>?R\<^esub>))
polynomial ?K ?p \<Longrightarrow> set ?p \<subseteq> ?K

goal (1 subgoal):
 1. set f \<union> {\<zero>} \<subseteq> K \<union> {\<zero>}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set f \<union> {\<zero>} \<subseteq> K \<union> {\<zero>}

goal (1 subgoal):
 1. local.coeff f i \<in> K
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set f \<union> {\<zero>} \<subseteq> K \<union> {\<zero>}

goal (1 subgoal):
 1. local.coeff f i \<in> K
[PROOF STEP]
have "... \<subseteq> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<union> {\<zero>} \<subseteq> K
[PROOF STEP]
using subringE[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
K \<subseteq> carrier R
\<zero> \<in> K
\<one> \<in> K
K \<noteq> {}
?h \<in> K \<Longrightarrow> \<ominus> ?h \<in> K
\<lbrakk>?h1.0 \<in> K; ?h2.0 \<in> K\<rbrakk> \<Longrightarrow> ?h1.0 \<otimes> ?h2.0 \<in> K
\<lbrakk>?h1.0 \<in> K; ?h2.0 \<in> K\<rbrakk> \<Longrightarrow> ?h1.0 \<oplus> ?h2.0 \<in> K

goal (1 subgoal):
 1. K \<union> {\<zero>} \<subseteq> K
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
K \<union> {\<zero>} \<subseteq> K

goal (1 subgoal):
 1. local.coeff f i \<in> K
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.coeff f i \<in> K
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.coeff f i \<in> K

goal (1 subgoal):
 1. local.coeff f i \<in> K
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.coeff f i \<in> K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ce_set_lm_2: "\<lbrakk> p \<in> PrimRec2; \<forall> x. (x \<in> A) = (\<exists> y. p x y = 0)\<rbrakk> \<Longrightarrow> A \<in> ce_sets"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> PrimRec2; \<forall>x. (x \<in> A) = (\<exists>y. p x y = 0)\<rbrakk> \<Longrightarrow> A \<in> ce_sets
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>p \<in> PrimRec2; \<forall>x. (x \<in> A) = (\<exists>y. p x y = 0)\<rbrakk> \<Longrightarrow> A \<in> ce_sets
[PROOF STEP]
assume p_is_pr: "p \<in> PrimRec2"
[PROOF STATE]
proof (state)
this:
p \<in> PrimRec2

goal (1 subgoal):
 1. \<lbrakk>p \<in> PrimRec2; \<forall>x. (x \<in> A) = (\<exists>y. p x y = 0)\<rbrakk> \<Longrightarrow> A \<in> ce_sets
[PROOF STEP]
assume "\<forall> x. (x \<in> A) = (\<exists> y. p x y = 0)"
[PROOF STATE]
proof (state)
this:
\<forall>x. (x \<in> A) = (\<exists>y. p x y = 0)

goal (1 subgoal):
 1. \<lbrakk>p \<in> PrimRec2; \<forall>x. (x \<in> A) = (\<exists>y. p x y = 0)\<rbrakk> \<Longrightarrow> A \<in> ce_sets
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. (x \<in> A) = (\<exists>y. p x y = 0)
[PROOF STEP]
have "A = fn_to_set p"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. (x \<in> A) = (\<exists>y. p x y = 0)

goal (1 subgoal):
 1. A = fn_to_set p
[PROOF STEP]
by (unfold fn_to_set_def, auto)
[PROOF STATE]
proof (state)
this:
A = fn_to_set p

goal (1 subgoal):
 1. \<lbrakk>p \<in> PrimRec2; \<forall>x. (x \<in> A) = (\<exists>y. p x y = 0)\<rbrakk> \<Longrightarrow> A \<in> ce_sets
[PROOF STEP]
with p_is_pr
[PROOF STATE]
proof (chain)
picking this:
p \<in> PrimRec2
A = fn_to_set p
[PROOF STEP]
show "A \<in> ce_sets"
[PROOF STATE]
proof (prove)
using this:
p \<in> PrimRec2
A = fn_to_set p

goal (1 subgoal):
 1. A \<in> ce_sets
[PROOF STEP]
by (simp add: ce_set_lm_1)
[PROOF STATE]
proof (state)
this:
A \<in> ce_sets

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fst_proj_mem [simp]: "(A \<in> fst_proj M) = (\<exists>B. (A,B)\<in>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<in> fst_proj M) = (\<exists>B. (A, B) \<in> M)
[PROOF STEP]
unfolding fst_proj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<in> {A. \<exists>B. (A, B) \<in> M}) = (\<exists>B. (A, B) \<in> M)
[PROOF STEP]
by auto


[STATEMENT]
lemma prod_encode_prod_decode_aux: "prod_encode (prod_decode_aux k m) = triangle k + m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_encode (prod_decode_aux k m) = triangle k + m
[PROOF STEP]
proof (induction k m rule: prod_decode_aux.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k m. (\<not> m \<le> k \<Longrightarrow> prod_encode (prod_decode_aux (Suc k) (m - Suc k)) = triangle (Suc k) + (m - Suc k)) \<Longrightarrow> prod_encode (prod_decode_aux k m) = triangle k + m
[PROOF STEP]
case (1 k m)
[PROOF STATE]
proof (state)
this:
\<not> m \<le> k \<Longrightarrow> prod_encode (prod_decode_aux (Suc k) (m - Suc k)) = triangle (Suc k) + (m - Suc k)

goal (1 subgoal):
 1. \<And>k m. (\<not> m \<le> k \<Longrightarrow> prod_encode (prod_decode_aux (Suc k) (m - Suc k)) = triangle (Suc k) + (m - Suc k)) \<Longrightarrow> prod_encode (prod_decode_aux k m) = triangle k + m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> m \<le> k \<Longrightarrow> prod_encode (prod_decode_aux (Suc k) (m - Suc k)) = triangle (Suc k) + (m - Suc k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<not> m \<le> k \<Longrightarrow> prod_encode (prod_decode_aux (Suc k) (m - Suc k)) = triangle (Suc k) + (m - Suc k)

goal (1 subgoal):
 1. prod_encode (prod_decode_aux k m) = triangle k + m
[PROOF STEP]
by (simp add: prod_encode_def prod_decode_aux.simps)
[PROOF STATE]
proof (state)
this:
prod_encode (prod_decode_aux k m) = triangle k + m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_of_enat_Sup:
  assumes "A \<noteq> {}" shows "ereal_of_enat (Sup A) = (SUP a \<in> A. ereal_of_enat a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal_of_enat (Sup A) = Sup (ereal_of_enat ` A)
[PROOF STEP]
proof (intro antisym mono_Sup)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
 2. mono ereal_of_enat
[PROOF STEP]
show "ereal_of_enat (Sup A) \<le> (SUP a \<in> A. ereal_of_enat a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
 2. \<not> ?P \<Longrightarrow> ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
[PROOF STEP]
assume "finite A"
[PROOF STATE]
proof (state)
this:
finite A

goal (2 subgoals):
 1. ?P \<Longrightarrow> ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
 2. \<not> ?P \<Longrightarrow> ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
[PROOF STEP]
with \<open>A \<noteq> {}\<close>
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> {}
finite A
[PROOF STEP]
obtain a where "a \<in> A" "ereal_of_enat (Sup A) = ereal_of_enat a"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
finite A

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> A; ereal_of_enat (Sup A) = ereal_of_enat a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Max_in[of A]
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
finite A
\<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> Max A \<in> A

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> A; ereal_of_enat (Sup A) = ereal_of_enat a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: Sup_enat_def simp del: Max_in)
[PROOF STATE]
proof (state)
this:
a \<in> A
ereal_of_enat (Sup A) = ereal_of_enat a

goal (2 subgoals):
 1. ?P \<Longrightarrow> ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
 2. \<not> ?P \<Longrightarrow> ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> A
ereal_of_enat (Sup A) = ereal_of_enat a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> A
ereal_of_enat (Sup A) = ereal_of_enat a

goal (1 subgoal):
 1. ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
[PROOF STEP]
by (auto intro: SUP_upper)
[PROOF STATE]
proof (state)
this:
ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)

goal (1 subgoal):
 1. infinite A \<Longrightarrow> ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite A \<Longrightarrow> ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
[PROOF STEP]
assume "\<not> finite A"
[PROOF STATE]
proof (state)
this:
infinite A

goal (1 subgoal):
 1. infinite A \<Longrightarrow> ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
[PROOF STEP]
have [simp]: "(SUP a \<in> A. ereal_of_enat a) = top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (ereal_of_enat ` A) = top
[PROOF STEP]
unfolding SUP_eq_top_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x<top. \<exists>i\<in>A. x < ereal_of_enat i
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x < top \<Longrightarrow> \<exists>i\<in>A. x < ereal_of_enat i
[PROOF STEP]
fix x :: ereal
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x < top \<Longrightarrow> \<exists>i\<in>A. x < ereal_of_enat i
[PROOF STEP]
assume "x < top"
[PROOF STATE]
proof (state)
this:
x < top

goal (1 subgoal):
 1. \<And>x. x < top \<Longrightarrow> \<exists>i\<in>A. x < ereal_of_enat i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < top
[PROOF STEP]
obtain n :: nat where "x < n"
[PROOF STATE]
proof (prove)
using this:
x < top

goal (1 subgoal):
 1. (\<And>n. x < ereal (real n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using less_PInf_Ex_of_nat top_ereal_def
[PROOF STATE]
proof (prove)
using this:
x < top
(?x \<noteq> \<infinity>) = (\<exists>n. ?x < ereal (real n))
top = \<infinity>

goal (1 subgoal):
 1. (\<And>n. x < ereal (real n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x < ereal (real n)

goal (1 subgoal):
 1. \<And>x. x < top \<Longrightarrow> \<exists>i\<in>A. x < ereal_of_enat i
[PROOF STEP]
obtain a where "a \<in> A - enat ` {.. n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. a \<in> A - enat ` {..n} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>\<not> finite A\<close> all_not_in_conv finite_Diff2 finite_atMost finite_imageI finite.emptyI)
[PROOF STATE]
proof (state)
this:
a \<in> A - enat ` {..n}

goal (1 subgoal):
 1. \<And>x. x < top \<Longrightarrow> \<exists>i\<in>A. x < ereal_of_enat i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> A - enat ` {..n}
[PROOF STEP]
have "a \<in> A" "ereal n \<le> ereal_of_enat a"
[PROOF STATE]
proof (prove)
using this:
a \<in> A - enat ` {..n}

goal (1 subgoal):
 1. a \<in> A &&& ereal (real n) \<le> ereal_of_enat a
[PROOF STEP]
by (auto simp: image_iff Ball_def)
           (metis enat_iless enat_ord_simps(1) ereal_of_enat_less_iff ereal_of_enat_simps(1) less_le not_less)
[PROOF STATE]
proof (state)
this:
a \<in> A
ereal (real n) \<le> ereal_of_enat a

goal (1 subgoal):
 1. \<And>x. x < top \<Longrightarrow> \<exists>i\<in>A. x < ereal_of_enat i
[PROOF STEP]
with \<open>x < n\<close>
[PROOF STATE]
proof (chain)
picking this:
x < ereal (real n)
a \<in> A
ereal (real n) \<le> ereal_of_enat a
[PROOF STEP]
show "\<exists>i\<in>A. x < ereal_of_enat i"
[PROOF STATE]
proof (prove)
using this:
x < ereal (real n)
a \<in> A
ereal (real n) \<le> ereal_of_enat a

goal (1 subgoal):
 1. \<exists>i\<in>A. x < ereal_of_enat i
[PROOF STEP]
by (auto intro!: bexI[of _ a])
[PROOF STATE]
proof (state)
this:
\<exists>i\<in>A. x < ereal_of_enat i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Sup (ereal_of_enat ` A) = top

goal (1 subgoal):
 1. infinite A \<Longrightarrow> ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ereal_of_enat (Sup A) \<le> Sup (ereal_of_enat ` A)

goal (1 subgoal):
 1. mono ereal_of_enat
[PROOF STEP]
qed (simp add: mono_def)


[STATEMENT]
lemma powr_eventually_exp_ln':
  assumes "x > 0"
  shows   "eventually (\<lambda>x. (x::real) powr p = exp (p * ln x)) (nhds x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. x powr p = exp (p * ln x)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. x powr p = exp (p * ln x)
[PROOF STEP]
let ?A = "{(0::real)<..}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. x powr p = exp (p * ln x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < x
[PROOF STEP]
have "eventually (\<lambda>x. x > 0) (nhds x)"
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. eventually ((<) 0) (nhds x)
[PROOF STEP]
unfolding eventually_nhds
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. \<exists>S. open S \<and> x \<in> S \<and> Ball S ((<) 0)
[PROOF STEP]
by (intro exI[of _ "{(0::real)<..}"]) simp_all
[PROOF STATE]
proof (state)
this:
eventually ((<) 0) (nhds x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. x powr p = exp (p * ln x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) (nhds x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. x powr p = exp (p * ln x)
[PROOF STEP]
by eventually_elim (simp add: powr_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds x. x powr p = exp (p * ln x)

goal:
No subgoals!
[PROOF STEP]
qed