[STATEMENT]
lemma facet_of_convex_hull_affine_independent:
  fixes S :: "'a::euclidean_space set"
  assumes "\<not> affine_dependent S"
    shows "T facet_of (convex hull S) \<longleftrightarrow>
           T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))"
          (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T facet_of convex hull S) = (T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. T facet_of convex hull S \<Longrightarrow> T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
 2. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
T facet_of convex hull S

goal (2 subgoals):
 1. T facet_of convex hull S \<Longrightarrow> T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
 2. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
T facet_of convex hull S
[PROOF STEP]
have "T face_of (convex hull S)" "T \<noteq> {}"
        and afft: "aff_dim T = aff_dim (convex hull S) - 1"
[PROOF STATE]
proof (prove)
using this:
T facet_of convex hull S

goal (1 subgoal):
 1. (T face_of convex hull S &&& T \<noteq> {}) &&& aff_dim T = aff_dim (convex hull S) - 1
[PROOF STEP]
by (auto simp: facet_of_def)
[PROOF STATE]
proof (state)
this:
T face_of convex hull S
T \<noteq> {}
aff_dim T = aff_dim (convex hull S) - 1

goal (2 subgoals):
 1. T facet_of convex hull S \<Longrightarrow> T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
 2. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
T face_of convex hull S
T \<noteq> {}
aff_dim T = aff_dim (convex hull S) - 1
[PROOF STEP]
obtain c where "c \<subseteq> S" and c: "T = convex hull c"
[PROOF STATE]
proof (prove)
using this:
T face_of convex hull S
T \<noteq> {}
aff_dim T = aff_dim (convex hull S) - 1

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>c \<subseteq> S; T = convex hull c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: face_of_convex_hull_affine_independent [OF assms])
[PROOF STATE]
proof (state)
this:
c \<subseteq> S
T = convex hull c

goal (2 subgoals):
 1. T facet_of convex hull S \<Longrightarrow> T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
 2. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<subseteq> S
T = convex hull c
[PROOF STEP]
have affs: "aff_dim S = aff_dim c + 1"
[PROOF STATE]
proof (prove)
using this:
c \<subseteq> S
T = convex hull c

goal (1 subgoal):
 1. aff_dim S = aff_dim c + 1
[PROOF STEP]
by (metis aff_dim_convex_hull afft eq_diff_eq)
[PROOF STATE]
proof (state)
this:
aff_dim S = aff_dim c + 1

goal (2 subgoals):
 1. T facet_of convex hull S \<Longrightarrow> T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
 2. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
have "\<not> affine_dependent c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> affine_dependent c
[PROOF STEP]
using \<open>c \<subseteq> S\<close> affine_dependent_subset assms
[PROOF STATE]
proof (prove)
using this:
c \<subseteq> S
\<lbrakk>affine_dependent ?s; ?s \<subseteq> ?t\<rbrakk> \<Longrightarrow> affine_dependent ?t
\<not> affine_dependent S

goal (1 subgoal):
 1. \<not> affine_dependent c
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> affine_dependent c

goal (2 subgoals):
 1. T facet_of convex hull S \<Longrightarrow> T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
 2. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
with affs
[PROOF STATE]
proof (chain)
picking this:
aff_dim S = aff_dim c + 1
\<not> affine_dependent c
[PROOF STEP]
have "card (S - c) = 1"
[PROOF STATE]
proof (prove)
using this:
aff_dim S = aff_dim c + 1
\<not> affine_dependent c

goal (1 subgoal):
 1. card (S - c) = 1
[PROOF STEP]
apply (simp add: aff_dim_affine_independent [symmetric] aff_dim_convex_hull)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>aff_dim S = int (card c); \<not> affine_dependent c\<rbrakk> \<Longrightarrow> card (S - c) = Suc 0
[PROOF STEP]
by (metis aff_dim_affine_independent aff_independent_finite One_nat_def \<open>c \<subseteq> S\<close> add.commute
                add_diff_cancel_right' assms card_Diff_subset card_mono of_nat_1 of_nat_diff of_nat_eq_iff)
[PROOF STATE]
proof (state)
this:
card (S - c) = 1

goal (2 subgoals):
 1. T facet_of convex hull S \<Longrightarrow> T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
 2. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (S - c) = 1
[PROOF STEP]
obtain u where u: "u \<in> S - c"
[PROOF STATE]
proof (prove)
using this:
card (S - c) = 1

goal (1 subgoal):
 1. (\<And>u. u \<in> S - c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis DiffI \<open>c \<subseteq> S\<close> aff_independent_finite assms cancel_comm_monoid_add_class.diff_cancel
                card_Diff_subset subsetI subset_antisym zero_neq_one)
[PROOF STATE]
proof (state)
this:
u \<in> S - c

goal (2 subgoals):
 1. T facet_of convex hull S \<Longrightarrow> T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
 2. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<in> S - c
[PROOF STEP]
have u: "S = insert u c"
[PROOF STATE]
proof (prove)
using this:
u \<in> S - c

goal (1 subgoal):
 1. S = insert u c
[PROOF STEP]
by (metis Diff_subset \<open>c \<subseteq> S\<close> \<open>card (S - c) = 1\<close> card_1_singletonE double_diff insert_Diff insert_subset singletonD)
[PROOF STATE]
proof (state)
this:
S = insert u c

goal (2 subgoals):
 1. T facet_of convex hull S \<Longrightarrow> T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
 2. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
have "T = convex hull (c - {u})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T = convex hull (c - {u})
[PROOF STEP]
by (metis Diff_empty Diff_insert0 \<open>T facet_of convex hull S\<close> c facet_of_irrefl insert_absorb u)
[PROOF STATE]
proof (state)
this:
T = convex hull (c - {u})

goal (2 subgoals):
 1. T facet_of convex hull S \<Longrightarrow> T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
 2. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
with \<open>T \<noteq> {}\<close>
[PROOF STATE]
proof (chain)
picking this:
T \<noteq> {}
T = convex hull (c - {u})
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
T \<noteq> {}
T = convex hull (c - {u})

goal (1 subgoal):
 1. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
[PROOF STEP]
using c u
[PROOF STATE]
proof (prove)
using this:
T \<noteq> {}
T = convex hull (c - {u})
T = convex hull c
S = insert u c

goal (1 subgoal):
 1. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))

goal (1 subgoal):
 1. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))

goal (1 subgoal):
 1. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))
[PROOF STEP]
obtain u where "T \<noteq> {}" "u \<in> S" and u: "T = convex hull (S - {u})"
[PROOF STATE]
proof (prove)
using this:
T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u}))

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>T \<noteq> {}; u \<in> S; T = convex hull (S - {u})\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: facet_of_def)
[PROOF STATE]
proof (state)
this:
T \<noteq> {}
u \<in> S
T = convex hull (S - {u})

goal (1 subgoal):
 1. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
T \<noteq> {}
u \<in> S
T = convex hull (S - {u})
[PROOF STEP]
have "\<not> S \<subseteq> {u}"
[PROOF STATE]
proof (prove)
using this:
T \<noteq> {}
u \<in> S
T = convex hull (S - {u})

goal (1 subgoal):
 1. \<not> S \<subseteq> {u}
[PROOF STEP]
using \<open>T \<noteq> {}\<close> u
[PROOF STATE]
proof (prove)
using this:
T \<noteq> {}
u \<in> S
T = convex hull (S - {u})
T \<noteq> {}
T = convex hull (S - {u})

goal (1 subgoal):
 1. \<not> S \<subseteq> {u}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> S \<subseteq> {u}

goal (1 subgoal):
 1. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
have "aff_dim (S - {u}) = aff_dim S - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim (S - {u}) = aff_dim S - 1
[PROOF STEP]
using assms \<open>u \<in> S\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> affine_dependent S
u \<in> S

goal (1 subgoal):
 1. aff_dim (S - {u}) = aff_dim S - 1
[PROOF STEP]
unfolding affine_dependent_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>x\<in>S. x \<in> affine hull (S - {x}))
u \<in> S

goal (1 subgoal):
 1. aff_dim (S - {u}) = aff_dim S - 1
[PROOF STEP]
by (metis add_diff_cancel_right' aff_dim_insert insert_Diff [of u S])
[PROOF STATE]
proof (state)
this:
aff_dim (S - {u}) = aff_dim S - 1

goal (1 subgoal):
 1. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aff_dim (S - {u}) = aff_dim S - 1
[PROOF STEP]
have "aff_dim (convex hull (S - {u})) = aff_dim (convex hull S) - 1"
[PROOF STATE]
proof (prove)
using this:
aff_dim (S - {u}) = aff_dim S - 1

goal (1 subgoal):
 1. aff_dim (convex hull (S - {u})) = aff_dim (convex hull S) - 1
[PROOF STEP]
by (simp add: aff_dim_convex_hull)
[PROOF STATE]
proof (state)
this:
aff_dim (convex hull (S - {u})) = aff_dim (convex hull S) - 1

goal (1 subgoal):
 1. T \<noteq> {} \<and> (\<exists>u. u \<in> S \<and> T = convex hull (S - {u})) \<Longrightarrow> T facet_of convex hull S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aff_dim (convex hull (S - {u})) = aff_dim (convex hull S) - 1
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
aff_dim (convex hull (S - {u})) = aff_dim (convex hull S) - 1

goal (1 subgoal):
 1. T facet_of convex hull S
[PROOF STEP]
by (metis Diff_subset \<open>T \<noteq> {}\<close> assms face_of_convex_hull_affine_independent facet_of_def u)
[PROOF STATE]
proof (state)
this:
T facet_of convex hull S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma power_subdist: "x\<^bsup>n\<^esup> \<le> (x + y)\<^bsup>n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^bsup>n\<^esup> \<le> (x + y)\<^bsup>n\<^esup>
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x\<^bsup>0\<^esup> \<le> (x + y)\<^bsup>0\<^esup>
 2. \<And>n. x\<^bsup>n\<^esup> \<le> (x + y)\<^bsup>n\<^esup> \<Longrightarrow> x\<^bsup>Suc n\<^esup> \<le> (x + y)\<^bsup>Suc n\<^esup>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. x\<^bsup>n\<^esup> \<le> (x + y)\<^bsup>n\<^esup> \<Longrightarrow> x\<^bsup>Suc n\<^esup> \<le> (x + y)\<^bsup>Suc n\<^esup>
[PROOF STEP]
using local.mult_isol_var local.power_Suc2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?u \<le> ?x; ?v \<le> ?y\<rbrakk> \<Longrightarrow> ?u \<cdot> ?v \<le> ?x \<cdot> ?y
?a\<^bsup>Suc ?n\<^esup> = ?a\<^bsup>?n\<^esup> \<cdot> ?a

goal (1 subgoal):
 1. \<And>n. x\<^bsup>n\<^esup> \<le> (x + y)\<^bsup>n\<^esup> \<Longrightarrow> x\<^bsup>Suc n\<^esup> \<le> (x + y)\<^bsup>Suc n\<^esup>
[PROOF STEP]
by auto


[STATEMENT]
lemma sq_mtx_inv_mult:
  assumes "mtx_invertible A" and "mtx_invertible B"
  shows "(A * B)\<^sup>-\<^sup>1 = B\<^sup>-\<^sup>1 * A\<^sup>-\<^sup>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A * B)\<^sup>-\<^sup>1 = B\<^sup>-\<^sup>1 * A\<^sup>-\<^sup>1
[PROOF STEP]
by (simp add: assms matrix_inv_matrix_mul sq_mtx_inv_def times_sq_mtx_def)


[STATEMENT]
theorem F1map_cong: "\<lbrakk>\<And>z. z \<in> F1set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F1set2 x \<Longrightarrow> f2 z = g2 z\<rbrakk>
  \<Longrightarrow> F1map f1 f2 x = F1map g1 g2 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>z. z \<in> F1set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F2set x \<Longrightarrow> f2 z = g2 z\<rbrakk> \<Longrightarrow> F1map f1 f2 x = F1map g1 g2 x
[PROOF STEP]
apply (rule F.map_cong0)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>z1. \<lbrakk>\<And>z. z \<in> F1set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F2set x \<Longrightarrow> f2 z = g2 z; z1 \<in> Fset1 x\<rbrakk> \<Longrightarrow> id z1 = id z1
 2. \<And>z2. \<lbrakk>\<And>z. z \<in> F1set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F2set x \<Longrightarrow> f2 z = g2 z; z2 \<in> F1set1 x\<rbrakk> \<Longrightarrow> f1 z2 = g1 z2
 3. \<And>z3. \<lbrakk>\<And>z. z \<in> F1set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F2set x \<Longrightarrow> f2 z = g2 z; z3 \<in> F2set x\<rbrakk> \<Longrightarrow> f2 z3 = g2 z3
[PROOF STEP]
apply (rule refl)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>z2. \<lbrakk>\<And>z. z \<in> F1set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F2set x \<Longrightarrow> f2 z = g2 z; z2 \<in> F1set1 x\<rbrakk> \<Longrightarrow> f1 z2 = g1 z2
 2. \<And>z3. \<lbrakk>\<And>z. z \<in> F1set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F2set x \<Longrightarrow> f2 z = g2 z; z3 \<in> F2set x\<rbrakk> \<Longrightarrow> f2 z3 = g2 z3
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z3. \<lbrakk>\<And>z. z \<in> F1set1 x \<Longrightarrow> f1 z = g1 z; \<And>z. z \<in> F2set x \<Longrightarrow> f2 z = g2 z; z3 \<in> F2set x\<rbrakk> \<Longrightarrow> f2 z3 = g2 z3
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem vec_vec_Tensor_length :
 "(length(vec_vec_Tensor x y)) = (length x)*(length y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (vec_vec_Tensor x y) = length x * length y
[PROOF STEP]
by(induction x)(auto simp add: preserving_length)


[STATEMENT]
lemma fls_deriv_X_power:
  "fls_deriv (fls_X ^ n) = of_nat n * fls_X ^ (n-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_deriv (fls_X ^ n) = of_nat n * fls_X ^ (n - 1)
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fls_deriv (fls_X ^ n) = of_nat n * fls_X ^ (n - 1)
 2. \<And>nat. n = Suc nat \<Longrightarrow> fls_deriv (fls_X ^ n) = of_nat n * fls_X ^ (n - 1)
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
n = Suc m

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fls_deriv (fls_X ^ n) = of_nat n * fls_X ^ (n - 1)
 2. \<And>nat. n = Suc nat \<Longrightarrow> fls_deriv (fls_X ^ n) = of_nat n * fls_X ^ (n - 1)
[PROOF STEP]
have "fls_deriv (fls_X^Suc m) = of_nat (Suc m) * fls_X^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_deriv (fls_X ^ Suc m) = of_nat (Suc m) * fls_X ^ m
[PROOF STEP]
by (induct m) (simp_all add: mult_of_nat_commute algebra_simps)
[PROOF STATE]
proof (state)
this:
fls_deriv (fls_X ^ Suc m) = of_nat (Suc m) * fls_X ^ m

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fls_deriv (fls_X ^ n) = of_nat n * fls_X ^ (n - 1)
 2. \<And>nat. n = Suc nat \<Longrightarrow> fls_deriv (fls_X ^ n) = of_nat n * fls_X ^ (n - 1)
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
n = Suc m
fls_deriv (fls_X ^ Suc m) = of_nat (Suc m) * fls_X ^ m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc m
fls_deriv (fls_X ^ Suc m) = of_nat (Suc m) * fls_X ^ m

goal (1 subgoal):
 1. fls_deriv (fls_X ^ n) = of_nat n * fls_X ^ (n - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_deriv (fls_X ^ n) = of_nat n * fls_X ^ (n - 1)

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> fls_deriv (fls_X ^ n) = of_nat n * fls_X ^ (n - 1)
[PROOF STEP]
qed simp


[STATEMENT]
lemma three_subset: "\<lbrakk>x \<noteq> y; x \<noteq> z; y \<noteq> z; {x,y,z} \<subseteq> X\<rbrakk> \<Longrightarrow> card X \<ge> 3 \<or> infinite X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; x \<noteq> z; y \<noteq> z; {x, y, z} \<subseteq> X\<rbrakk> \<Longrightarrow> 3 \<le> card X \<or> infinite X
[PROOF STEP]
apply (case_tac "finite X")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<noteq> y; x \<noteq> z; y \<noteq> z; {x, y, z} \<subseteq> X; finite X\<rbrakk> \<Longrightarrow> 3 \<le> card X \<or> infinite X
 2. \<lbrakk>x \<noteq> y; x \<noteq> z; y \<noteq> z; {x, y, z} \<subseteq> X; infinite X\<rbrakk> \<Longrightarrow> 3 \<le> card X \<or> infinite X
[PROOF STEP]
apply (auto simp : card_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; x \<noteq> z; y \<noteq> z; finite X; x \<in> X; y \<in> X; z \<in> X\<rbrakk> \<Longrightarrow> 3 \<le> card X
[PROOF STEP]
apply (erule_tac Y = "{x,y,z}" in card_subset_finite)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<noteq> y; x \<noteq> z; y \<noteq> z; x \<in> X; y \<in> X; z \<in> X\<rbrakk> \<Longrightarrow> card {x, y, z} = 3
 2. \<lbrakk>x \<noteq> y; x \<noteq> z; y \<noteq> z; x \<in> X; y \<in> X; z \<in> X\<rbrakk> \<Longrightarrow> {x, y, z} \<subseteq> X
[PROOF STEP]
by auto


[STATEMENT]
lemma cosine_law_triangle':
  "2 * dist a b * dist a c * cos (angle b a c) = (dist a b ^ 2 + dist a c ^ 2 - dist b c ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * dist a b * dist a c * cos (angle b a c) = (dist a b)\<^sup>2 + (dist a c)\<^sup>2 - (dist b c)\<^sup>2
[PROOF STEP]
using cosine_law_triangle[of b c a]
[PROOF STATE]
proof (prove)
using this:
(dist b c)\<^sup>2 = (dist a b)\<^sup>2 + (dist a c)\<^sup>2 - 2 * dist a b * dist a c * cos (angle b a c)

goal (1 subgoal):
 1. 2 * dist a b * dist a c * cos (angle b a c) = (dist a b)\<^sup>2 + (dist a c)\<^sup>2 - (dist b c)\<^sup>2
[PROOF STEP]
by simp


[STATEMENT]
lemma L2_set_mono:
  assumes "\<And>i. i \<in> K \<Longrightarrow> f i \<le> g i"
  assumes "\<And>i. i \<in> K \<Longrightarrow> 0 \<le> f i"
  shows "L2_set f K \<le> L2_set g K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L2_set f K \<le> L2_set g K
[PROOF STEP]
unfolding L2_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (\<Sum>i\<in>K. (f i)\<^sup>2) \<le> sqrt (\<Sum>i\<in>K. (g i)\<^sup>2)
[PROOF STEP]
by (simp add: sum_nonneg sum_mono power_mono assms)


[STATEMENT]
lemma geometric_pmf_prob_atMost:
  assumes "p \<in> {0<..1}"
  shows  "measure_pmf.prob (geometric_pmf p) {..n} = (1 - (1 - p)^(n + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob (geometric_pmf p) {..n} = 1 - (1 - p) ^ (n + 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. measure_pmf.prob (geometric_pmf p) {..n} = 1 - (1 - p) ^ (n + 1)
[PROOF STEP]
have "(\<Sum>x\<le>n. (1 - p) ^ x * p) = 1 - (1 - p) * (1 - p) ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<le>n. (1 - p) ^ x * p) = 1 - (1 - p) * (1 - p) ^ n
[PROOF STEP]
by (induction n) (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<le>n. (1 - p) ^ x * p) = 1 - (1 - p) * (1 - p) ^ n

goal (1 subgoal):
 1. measure_pmf.prob (geometric_pmf p) {..n} = 1 - (1 - p) ^ (n + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<le>n. (1 - p) ^ x * p) = 1 - (1 - p) * (1 - p) ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<le>n. (1 - p) ^ x * p) = 1 - (1 - p) * (1 - p) ^ n

goal (1 subgoal):
 1. measure_pmf.prob (geometric_pmf p) {..n} = 1 - (1 - p) ^ (n + 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<le>n. (1 - p) ^ x * p) = 1 - (1 - p) * (1 - p) ^ n
p \<in> {0<..1}

goal (1 subgoal):
 1. measure_pmf.prob (geometric_pmf p) {..n} = 1 - (1 - p) ^ (n + 1)
[PROOF STEP]
by (auto simp add: measure_pmf_conv_infsetsum)
[PROOF STATE]
proof (state)
this:
measure_pmf.prob (geometric_pmf p) {..n} = 1 - (1 - p) ^ (n + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma not_equal_vector7 :
  fixes x::"real^7" and  y::"real^7"
  assumes "x = vector[x1,x2,x3,x4,x5,x6,x7] " and "y= vector [y1,y2,y3,y4,y5,y6,y7]"
and  "x$1 \<noteq> y$1 \<or> x$2 \<noteq> y$2 \<or> x$3 \<noteq> y$3 \<or> x$4 \<noteq> y$4 \<or> x$5 \<noteq> y$5 \<or> x$6 \<noteq> y$6 \<or>  x$7 \<noteq> y$7    "
shows "x \<noteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x = vector [x1, x2, x3, x4, x5, x6, x7]
y = vector [y1, y2, y3, y4, y5, y6, y7]
x $ 1 \<noteq> y $ 1 \<or> x $ 2 \<noteq> y $ 2 \<or> x $ 3 \<noteq> y $ 3 \<or> x $ 4 \<noteq> y $ 4 \<or> x $ 5 \<noteq> y $ 5 \<or> x $ 6 \<noteq> y $ 6 \<or> x $ 7 \<noteq> y $ 7

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


[STATEMENT]
lemma Im_divide: "Im (x / y) = (Im x * Re y - Re x * Im y) / ((Re y)\<^sup>2 + (Im y)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (x / y) = (Im x * Re y - Re x * Im y) / ((Re y)\<^sup>2 + (Im y)\<^sup>2)
[PROOF STEP]
by (simp add: divide_complex_def diff_divide_distrib)


[STATEMENT]
theorem expected_lookup_cost:
  assumes "bst t" "t \<noteq> Leaf"
  shows   "measure_pmf.expectation (pmf_of_set (set_tree t)) (\<lambda>x. lookup_cost x t) =
             ipl t / size t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation (pmf_of_set (set_tree t)) (\<lambda>x. real (lookup_cost x t)) = real (ipl t) / real (size t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bst t
t \<noteq> \<langle>\<rangle>

goal (1 subgoal):
 1. measure_pmf.expectation (pmf_of_set (set_tree t)) (\<lambda>x. real (lookup_cost x t)) = real (ipl t) / real (size t)
[PROOF STEP]
by (subst integral_pmf_of_set)
                 (simp_all add: sum_lookup_costs of_nat_sum [symmetric] card_set_tree_bst)


[STATEMENT]
lemma measure_pmf_of_list:
  assumes "pmf_of_list_wf xs"
  shows   "measure (pmf_of_list xs) A = sum_list (map snd (filter (\<lambda>x. fst x \<in> A) xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob (pmf_of_list xs) A = sum_list (map snd (filter (\<lambda>x. fst x \<in> A) xs))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pmf_of_list_wf xs

goal (1 subgoal):
 1. measure_pmf.prob (pmf_of_list xs) A = sum_list (map snd (filter (\<lambda>x. fst x \<in> A) xs))
[PROOF STEP]
unfolding pmf_of_list_wf_def Sigma_Algebra.measure_def
[PROOF STATE]
proof (prove)
using this:
Ball (set (map snd xs)) ((\<le>) 0) \<and> sum_list (map snd xs) = 1

goal (1 subgoal):
 1. enn2real (emeasure (measure_pmf (pmf_of_list xs)) A) = sum_list (map snd (filter (\<lambda>x. fst x \<in> A) xs))
[PROOF STEP]
by (subst emeasure_pmf_of_list [OF assms], subst enn2real_ennreal) (auto intro!: sum_list_nonneg)


[STATEMENT]
lemma sin_diff_sin: "sin w - sin z = 2 * sin ((w - z) / 2) * cos ((w + z) / 2)"
  for w :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin w - sin z = (2::'a) * sin ((w - z) / (2::'a)) * cos ((w + z) / (2::'a))
[PROOF STEP]
apply (simp add: mult.assoc sin_times_cos)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin w * (2::'a) - sin z * (2::'a) = (2::'a) * sin ((w - z) / (2::'a) + (w + z) / (2::'a)) + (2::'a) * sin ((w - z) / (2::'a) - (w + z) / (2::'a))
[PROOF STEP]
apply (simp add: field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma higher_deriv_power:
  shows   "(deriv ^^ j) (\<lambda>w. (w - z) ^ n) w =
             pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)
[PROOF STEP]
proof (induction j arbitrary: w)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>w. (deriv ^^ 0) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - 0)) 0 * (w - z) ^ (n - 0)
 2. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>w. (deriv ^^ 0) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - 0)) 0 * (w - z) ^ (n - 0)
 2. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ 0) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - 0)) 0 * (w - z) ^ (n - 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(deriv ^^ 0) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - 0)) 0 * (w - z) ^ (n - 0)

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
case (Suc j w)
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (\<lambda>w. (w - z) ^ n) ?w = pochhammer (of_nat (Suc n - j)) j * (?w - z) ^ (n - j)

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
have "(deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = deriv ((deriv ^^ j) (\<lambda>w. (w - z) ^ n)) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = deriv ((deriv ^^ j) (\<lambda>w. (w - z) ^ n)) w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = deriv ((deriv ^^ j) (\<lambda>w. (w - z) ^ n)) w

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = deriv ((deriv ^^ j) (\<lambda>w. (w - z) ^ n)) w

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
have "(deriv ^^ j) (\<lambda>w. (w - z) ^ n) =
               (\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) = (\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j))
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
(deriv ^^ j) (\<lambda>w. (w - z) ^ n) ?w = pochhammer (of_nat (Suc n - j)) j * (?w - z) ^ (n - j)

goal (1 subgoal):
 1. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) = (\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j))
[PROOF STEP]
by (intro Suc.IH ext)
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (\<lambda>w. (w - z) ^ n) = (\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j))

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (\<lambda>w. (w - z) ^ n) = (\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j))

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (\<lambda>w. (w - z) ^ n) = (\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j))

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
have "(\<dots> has_field_derivative of_nat (n - j) *
               pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - Suc j)) (at w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) has_field_derivative of_nat (n - j) * pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - Suc j)) (at w)
[PROOF STEP]
using Suc.prems
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) has_field_derivative of_nat (n - j) * pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - Suc j)) (at w)
[PROOF STEP]
by (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) has_field_derivative of_nat (n - j) * pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - Suc j)) (at w)

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) has_field_derivative of_nat (n - j) * pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - Suc j)) (at w)

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
have "of_nat (n - j) * pochhammer (of_nat (Suc n - j)) j =
                 pochhammer (of_nat (Suc n - Suc j)) (Suc j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (n - j) * pochhammer (of_nat (Suc n - j)) j = pochhammer (of_nat (Suc n - Suc j)) (Suc j)
[PROOF STEP]
by (cases "Suc j \<le> n", subst pochhammer_rec)
         (insert Suc.prems, simp_all add: algebra_simps Suc_diff_le pochhammer_0_left)
[PROOF STATE]
proof (state)
this:
of_nat (n - j) * pochhammer (of_nat (Suc n - j)) j = pochhammer (of_nat (Suc n - Suc j)) (Suc j)

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) has_field_derivative pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)) (at w)
[PROOF STEP]
have "deriv (\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) w =
                    \<dots> * (w - z) ^ (n - Suc j)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) has_field_derivative pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)) (at w)

goal (1 subgoal):
 1. deriv (\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
by (rule DERIV_imp_deriv)
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>w. pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)

goal (1 subgoal):
 1. \<And>j w. (\<And>w. (deriv ^^ j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - j)) j * (w - z) ^ (n - j)) \<Longrightarrow> (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)

goal (1 subgoal):
 1. (deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(deriv ^^ Suc j) (\<lambda>w. (w - z) ^ n) w = pochhammer (of_nat (Suc n - Suc j)) (Suc j) * (w - z) ^ (n - Suc j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dirichlet_prod_prime_power:
  assumes "prime p"
  shows   "dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))
[PROOF STEP]
have "dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ k div p ^ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ k div p ^ i))
[PROOF STEP]
unfolding dirichlet_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd p ^ k. f d * g (p ^ k div d)) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ k div p ^ i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. (\<Sum>d | d dvd p ^ k. f d * g (p ^ k div d)) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ k div p ^ i))
[PROOF STEP]
by (intro sum.reindex_bij_betw [symmetric] bij_betw_prime_power_divisors)
[PROOF STATE]
proof (state)
this:
dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ k div p ^ i))

goal (1 subgoal):
 1. dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ k div p ^ i))

goal (1 subgoal):
 1. dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
prime p
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))"
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. (\<Sum>i\<le>k. f (p ^ i) * g (p ^ k div p ^ i)) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))
[PROOF STEP]
by (intro sum.cong refl) (auto simp: power_diff')
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. f (p ^ i) * g (p ^ k div p ^ i)) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))

goal (1 subgoal):
 1. dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))

goal (1 subgoal):
 1. dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dirichlet_prod f g (p ^ k) = (\<Sum>i\<le>k. f (p ^ i) * g (p ^ (k - i)))

goal:
No subgoals!
[PROOF STEP]
qed