[STATEMENT]
lemma has_field_derivative_iff:
  "(f has_field_derivative D) (at x within S) \<longleftrightarrow>
    ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative D) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_field_derivative D) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)
[PROOF STEP]
have "((\<lambda>y. norm (f y - f x - D * (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within S)
      = ((\<lambda>y. (f y - f x) / (y - x) - D) \<longlongrightarrow> 0) (at x within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. norm (f y - f x - D * (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x) - D) \<longlongrightarrow> (0::'a)) (at x within S)
[PROOF STEP]
by (smt (verit, best) Lim_cong_within divide_diff_eq_iff norm_divide right_minus_eq tendsto_norm_zero_iff)
[PROOF STATE]
proof (state)
this:
((\<lambda>y. norm (f y - f x - D * (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x) - D) \<longlongrightarrow> (0::'a)) (at x within S)

goal (1 subgoal):
 1. (f has_field_derivative D) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>y. norm (f y - f x - D * (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x) - D) \<longlongrightarrow> (0::'a)) (at x within S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>y. norm (f y - f x - D * (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x) - D) \<longlongrightarrow> (0::'a)) (at x within S)

goal (1 subgoal):
 1. (f has_field_derivative D) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)
[PROOF STEP]
by (simp add: has_field_derivative_def has_derivative_iff_norm bounded_linear_mult_right LIM_zero_iff)
[PROOF STATE]
proof (state)
this:
(f has_field_derivative D) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_split_even_odd:
  fixes f :: "nat \<Rightarrow> real"
  shows "(\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1))
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Sum>i<2 * 0. if even i then f i else g i) = (\<Sum>i<0. f (2 * i)) + (\<Sum>i<0. g (2 * i + 1))
 2. \<And>n. (\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) \<Longrightarrow> (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<Sum>i<2 * 0. if even i then f i else g i) = (\<Sum>i<0. f (2 * i)) + (\<Sum>i<0. g (2 * i + 1))
 2. \<And>n. (\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) \<Longrightarrow> (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<2 * 0. if even i then f i else g i) = (\<Sum>i<0. f (2 * i)) + (\<Sum>i<0. g (2 * i + 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<2 * 0. if even i then f i else g i) = (\<Sum>i<0. f (2 * i)) + (\<Sum>i<0. g (2 * i + 1))

goal (1 subgoal):
 1. \<And>n. (\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) \<Longrightarrow> (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) \<Longrightarrow> (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1))

goal (1 subgoal):
 1. \<And>n. (\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) \<Longrightarrow> (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))
[PROOF STEP]
have "(\<Sum>i<2 * Suc n. if even i then f i else g i) =
    (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) + (f (2 * n) + g (2 * n + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) + (f (2 * n) + g (2 * n + 1))
[PROOF STEP]
using Suc.hyps
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1))

goal (1 subgoal):
 1. (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) + (f (2 * n) + g (2 * n + 1))
[PROOF STEP]
unfolding One_nat_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + Suc 0))

goal (1 subgoal):
 1. (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + Suc 0)) + (f (2 * n) + g (2 * n + Suc 0))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) + (f (2 * n) + g (2 * n + 1))

goal (1 subgoal):
 1. \<And>n. (\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) \<Longrightarrow> (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) + (f (2 * n) + g (2 * n + 1))

goal (1 subgoal):
 1. \<And>n. (\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) \<Longrightarrow> (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))
[PROOF STEP]
have "\<dots> = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) + (f (2 * n) + g (2 * n + 1)) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) + (f (2 * n) + g (2 * n + 1)) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))

goal (1 subgoal):
 1. \<And>n. (\<Sum>i<2 * n. if even i then f i else g i) = (\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) \<Longrightarrow> (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))

goal (1 subgoal):
 1. (\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>i<2 * Suc n. if even i then f i else g i) = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invertible_mat_smult_mat:
  fixes A :: "'a::comm_ring_1 mat"
  assumes inv_A: "invertible_mat A" and k: "k dvd 1"
  shows "invertible_mat (k \<cdot>\<^sub>m A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible_mat (k \<cdot>\<^sub>m A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. invertible_mat (k \<cdot>\<^sub>m A)
[PROOF STEP]
obtain n where A: "A \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. A \<in> carrier_mat n n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inv_A
[PROOF STATE]
proof (prove)
using this:
invertible_mat A

goal (1 subgoal):
 1. (\<And>n. A \<in> carrier_mat n n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding invertible_mat_def
[PROOF STATE]
proof (prove)
using this:
square_mat A \<and> (\<exists>B. inverts_mat A B \<and> inverts_mat B A)

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

goal (1 subgoal):
 1. invertible_mat (k \<cdot>\<^sub>m A)
[PROOF STEP]
have det_dvd_1: "Determinant.det A dvd 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.det A dvd (1::'a)
[PROOF STEP]
using inv_A invertible_iff_is_unit_JNF[OF A]
[PROOF STATE]
proof (prove)
using this:
invertible_mat A
invertible_mat A = (Determinant.det A dvd (1::'a))

goal (1 subgoal):
 1. Determinant.det A dvd (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Determinant.det A dvd (1::'a)

goal (1 subgoal):
 1. invertible_mat (k \<cdot>\<^sub>m A)
[PROOF STEP]
have "Determinant.det (k \<cdot>\<^sub>m A) = k ^ dim_col A * Determinant.det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.det (k \<cdot>\<^sub>m A) = k ^ dim_col A * Determinant.det A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Determinant.det (k \<cdot>\<^sub>m A) = k ^ dim_col A * Determinant.det A

goal (1 subgoal):
 1. invertible_mat (k \<cdot>\<^sub>m A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Determinant.det (k \<cdot>\<^sub>m A) = k ^ dim_col A * Determinant.det A

goal (1 subgoal):
 1. invertible_mat (k \<cdot>\<^sub>m A)
[PROOF STEP]
have "... dvd 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k ^ dim_col A * Determinant.det A dvd (1::'a)
[PROOF STEP]
by (rule unit_prod, insert k det_dvd_1 dvd_power_same, force+)
[PROOF STATE]
proof (state)
this:
k ^ dim_col A * Determinant.det A dvd (1::'a)

goal (1 subgoal):
 1. invertible_mat (k \<cdot>\<^sub>m A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Determinant.det (k \<cdot>\<^sub>m A) dvd (1::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Determinant.det (k \<cdot>\<^sub>m A) dvd (1::'a)

goal (1 subgoal):
 1. invertible_mat (k \<cdot>\<^sub>m A)
[PROOF STEP]
using invertible_iff_is_unit_JNF
[PROOF STATE]
proof (prove)
using this:
Determinant.det (k \<cdot>\<^sub>m A) dvd (1::'a)
?A \<in> carrier_mat ?n ?n \<Longrightarrow> invertible_mat ?A = (Determinant.det ?A dvd (1::?'a))

goal (1 subgoal):
 1. invertible_mat (k \<cdot>\<^sub>m A)
[PROOF STEP]
by (metis A smult_carrier_mat)
[PROOF STATE]
proof (state)
this:
invertible_mat (k \<cdot>\<^sub>m A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quasinorm_intersection_zero_space:
  "zero_space\<^sub>N (N1 \<inter>\<^sub>N N2) = zero_space\<^sub>N N1 \<inter> zero_space\<^sub>N N2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zero_space\<^sub>N (N1 \<inter>\<^sub>N N2) = zero_space\<^sub>N N1 \<inter> zero_space\<^sub>N N2
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. x \<in> zero_space\<^sub>N (N1 \<inter>\<^sub>N N2) \<Longrightarrow> x \<in> zero_space\<^sub>N N1
 2. \<And>x. x \<in> zero_space\<^sub>N (N1 \<inter>\<^sub>N N2) \<Longrightarrow> x \<in> zero_space\<^sub>N N2
 3. \<And>x. \<lbrakk>x \<in> zero_space\<^sub>N N1; x \<in> zero_space\<^sub>N N2\<rbrakk> \<Longrightarrow> x \<in> zero_space\<^sub>N (N1 \<inter>\<^sub>N N2)
[PROOF STEP]
unfolding quasinorm_intersection(1) zero_spaceN_iff
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. eNorm N1 x + eNorm N2 x = 0 \<Longrightarrow> eNorm N1 x = 0
 2. \<And>x. eNorm N1 x + eNorm N2 x = 0 \<Longrightarrow> eNorm N2 x = 0
 3. \<And>x. \<lbrakk>eNorm N1 x = 0; eNorm N2 x = 0\<rbrakk> \<Longrightarrow> eNorm N1 x + eNorm N2 x = 0
[PROOF STEP]
by (auto simp add: add_eq_0_iff_both_eq_0)


[STATEMENT]
lemma norm_cos_squared:
  "norm(cos z) ^ 2 = cos(Re z) ^ 2 + (exp(Im z) - inverse(exp(Im z))) ^ 2 / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod (cos z))\<^sup>2 = (cos (Re z))\<^sup>2 + (exp (Im z) - inverse (exp (Im z)))\<^sup>2 / 4
[PROOF STEP]
proof (cases z)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x1 x2. z = Complex x1 x2 \<Longrightarrow> (cmod (cos z))\<^sup>2 = (cos (Re z))\<^sup>2 + (exp (Im z) - inverse (exp (Im z)))\<^sup>2 / 4
[PROOF STEP]
case (Complex x1 x2)
[PROOF STATE]
proof (state)
this:
z = Complex x1 x2

goal (1 subgoal):
 1. \<And>x1 x2. z = Complex x1 x2 \<Longrightarrow> (cmod (cos z))\<^sup>2 = (cos (Re z))\<^sup>2 + (exp (Im z) - inverse (exp (Im z)))\<^sup>2 / 4
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = Complex x1 x2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z = Complex x1 x2

goal (1 subgoal):
 1. (cmod (cos z))\<^sup>2 = (cos (Re z))\<^sup>2 + (exp (Im z) - inverse (exp (Im z)))\<^sup>2 / 4
[PROOF STEP]
apply (simp only: cos_add cmod_power2 cos_of_real sin_of_real Complex_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z = complex_of_real x1 + \<i> * complex_of_real x2 \<Longrightarrow> (Re (complex_of_real (cos x1) * cos (\<i> * complex_of_real x2) - complex_of_real (sin x1) * sin (\<i> * complex_of_real x2)))\<^sup>2 + (Im (complex_of_real (cos x1) * cos (\<i> * complex_of_real x2) - complex_of_real (sin x1) * sin (\<i> * complex_of_real x2)))\<^sup>2 = (cos (Re (complex_of_real x1 + \<i> * complex_of_real x2)))\<^sup>2 + (exp (Im (complex_of_real x1 + \<i> * complex_of_real x2)) - inverse (exp (Im (complex_of_real x1 + \<i> * complex_of_real x2))))\<^sup>2 / 4
[PROOF STEP]
apply (simp add: cos_exp_eq sin_exp_eq exp_minus exp_of_real Re_divide Im_divide power_divide)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z = complex_of_real x1 + \<i> * complex_of_real x2 \<Longrightarrow> (cos x1 * (exp x2 / (exp x2)\<^sup>2 + exp x2))\<^sup>2 / 4 + (sin x1 * (exp x2 / (exp x2)\<^sup>2 - exp x2))\<^sup>2 / 4 = (cos x1)\<^sup>2 + (exp x2 - inverse (exp x2))\<^sup>2 / 4
[PROOF STEP]
apply (simp only: left_diff_distrib [symmetric] power_mult_distrib sin_squared_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z = complex_of_real x1 + \<i> * complex_of_real x2 \<Longrightarrow> (cos x1)\<^sup>2 * (exp x2 / (exp x2)\<^sup>2 + exp x2)\<^sup>2 / 4 + (1 - (cos x1)\<^sup>2) * (exp x2 / (exp x2)\<^sup>2 - exp x2)\<^sup>2 / 4 = (cos x1)\<^sup>2 + (exp x2 - inverse (exp x2))\<^sup>2 / 4
[PROOF STEP]
apply (simp add: power2_eq_square field_split_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(cmod (cos z))\<^sup>2 = (cos (Re z))\<^sup>2 + (exp (Im z) - inverse (exp (Im z)))\<^sup>2 / 4

goal:
No subgoals!
[PROOF STEP]
qed


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

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (adjoint A + adjoint B); j < dim_col (adjoint A + adjoint B)\<rbrakk> \<Longrightarrow> adjoint (A + B) $$ (i, j) = (adjoint A + adjoint B) $$ (i, j)
 2. dim_row (adjoint (A + B)) = dim_row (adjoint A + adjoint B)
 3. dim_col (adjoint (A + B)) = dim_col (adjoint A + adjoint B)
[PROOF STEP]
by( auto simp add: adjoint_eval)


[STATEMENT]
lemma Inf_closed_res_Fix:
  fixes X :: "'a::quantale set"
  assumes "Inf_closed_set X"
  and  "\<forall>x. \<forall>y \<in> X. x \<rightarrow> y \<in> X"
  and "\<forall>x. \<forall>y \<in> X. y \<leftarrow> x \<in> X"
shows "X = Fix (\<lambda>y. \<Sqinter>{x \<in> X. y \<le> x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = Fix (\<lambda>y. \<Sqinter> {x \<in> X. y \<le> x})
[PROOF STEP]
unfolding Fix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = {x. \<Sqinter> {xa \<in> X. x \<le> xa} = x}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> X \<Longrightarrow> \<Sqinter> {xa \<in> X. x \<le> xa} = x
 2. \<And>x. \<Sqinter> {xa \<in> X. x \<le> xa} = x \<Longrightarrow> x \<in> X
[PROOF STEP]
apply (rule antisym, simp_all add: Inf_lower le_Inf_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<Sqinter> {xa \<in> X. x \<le> xa} = x \<Longrightarrow> x \<in> X
[PROOF STEP]
by (metis (no_types, lifting) Inf_closed_set_def assms(1) mem_Collect_eq subsetI)


[STATEMENT]
lemma point_dist [simp]:
  "dist (Point xA yA) (Point xB yB) =  sqrt ((xA - xB)^2 + (yA - yB)^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (Point xA yA) (Point xB yB) = sqrt ((xA - xB)\<^sup>2 + (yA - yB)\<^sup>2)
[PROOF STEP]
unfolding point_dist_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt ((abscissa (Point xA yA - Point xB yB))\<^sup>2 + (ordinate (Point xA yA - Point xB yB))\<^sup>2) = sqrt ((xA - xB)\<^sup>2 + (yA - yB)\<^sup>2)
[PROOF STEP]
by simp


[STATEMENT]
lemma is_solution_eq_in_span_solve:
  fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
  assumes con: "consistent A b"
  shows "(is_solution x A b) = (x \<in> {fst (the (solve A b))} + vec.span (snd (the (solve A b))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_solution x A b = (x \<in> {fst (the (solve A b))} + vec.span (snd (the (solve A b))))
[PROOF STEP]
using solution_set_rel_solve[OF con]
[PROOF STATE]
proof (prove)
using this:
solution_set A b = {fst (the (solve A b))} + vec.span (snd (the (solve A b)))

goal (1 subgoal):
 1. is_solution x A b = (x \<in> {fst (the (solve A b))} + vec.span (snd (the (solve A b))))
[PROOF STEP]
unfolding solution_set_def
[PROOF STATE]
proof (prove)
using this:
{x. is_solution x A b} = {fst (the (solve A b))} + vec.span (snd (the (solve A b)))

goal (1 subgoal):
 1. is_solution x A b = (x \<in> {fst (the (solve A b))} + vec.span (snd (the (solve A b))))
[PROOF STEP]
by auto


[STATEMENT]
theorem (in prime_number_theorem)
  liminf_totient: "liminf (\<lambda>n. totient n * ln (ln n) / n) = third_mertens_const"
    (is "_ = ereal ?c")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) = ereal third_mertens_const
[PROOF STEP]
proof (intro antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const
 2. ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))
[PROOF STEP]
have "(\<lambda>k. totient (primorial' k) / (?c * primorial' k / ln (ln (primorial' k)))) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. real (totient (primorial' k)) / (third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> 1
[PROOF STEP]
using totient_primorial'_asymp_equiv'
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))

goal (1 subgoal):
 1. (\<lambda>k. real (totient (primorial' k)) / (third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> 1
[PROOF STEP]
by (intro asymp_equivD_strong eventually_mono[OF eventually_gt_at_top[of 1]]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>k. real (totient (primorial' k)) / (third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> 1

goal (2 subgoals):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const
 2. ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))
[PROOF STEP]
hence "(\<lambda>k. totient (primorial' k) / (?c * primorial' k / ln (ln (primorial' k))) * ?c)
             \<longlonglongrightarrow> 1 * ?c"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. real (totient (primorial' k)) / (third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. (\<lambda>k. real (totient (primorial' k)) / (third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k)))) * third_mertens_const) \<longlonglongrightarrow> 1 * third_mertens_const
[PROOF STEP]
by (intro tendsto_mult) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>k. real (totient (primorial' k)) / (third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k)))) * third_mertens_const) \<longlonglongrightarrow> 1 * third_mertens_const

goal (2 subgoals):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const
 2. ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))
[PROOF STEP]
hence "(\<lambda>k. totient (primorial' k) / (primorial' k / ln (ln (primorial' k)))) \<longlonglongrightarrow> ?c"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. real (totient (primorial' k)) / (third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k)))) * third_mertens_const) \<longlonglongrightarrow> 1 * third_mertens_const

goal (1 subgoal):
 1. (\<lambda>k. real (totient (primorial' k)) / (real (primorial' k) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> third_mertens_const
[PROOF STEP]
using third_mertens_const_pos
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. real (totient (primorial' k)) / (third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k)))) * third_mertens_const) \<longlonglongrightarrow> 1 * third_mertens_const
0 < third_mertens_const

goal (1 subgoal):
 1. (\<lambda>k. real (totient (primorial' k)) / (real (primorial' k) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> third_mertens_const
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>k. real (totient (primorial' k)) / (real (primorial' k) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> third_mertens_const

goal (2 subgoals):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const
 2. ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))
[PROOF STEP]
hence "liminf ((\<lambda>n. totient n * ln (ln n) / n) \<circ> primorial') = ereal ?c"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. real (totient (primorial' k)) / (real (primorial' k) / ln (ln (real (primorial' k))))) \<longlonglongrightarrow> third_mertens_const

goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (((\<lambda>n. real (totient n) * ln (ln (real n)) / real n) \<circ> primorial') x)) = ereal third_mertens_const
[PROOF STEP]
by (intro lim_imp_Liminf tendsto_ereal) simp_all
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>x. ereal (((\<lambda>n. real (totient n) * ln (ln (real n)) / real n) \<circ> primorial') x)) = ereal third_mertens_const

goal (2 subgoals):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const
 2. ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))
[PROOF STEP]
hence "?c = liminf ((\<lambda>n. ereal (totient n * ln (ln n) / n)) \<circ> primorial')"
[PROOF STATE]
proof (prove)
using this:
liminf (\<lambda>x. ereal (((\<lambda>n. real (totient n) * ln (ln (real n)) / real n) \<circ> primorial') x)) = ereal third_mertens_const

goal (1 subgoal):
 1. ereal third_mertens_const = liminf ((\<lambda>n. ereal (real (totient n) * ln (ln (real n)) / real n)) \<circ> primorial')
[PROOF STEP]
by (simp add: o_def)
[PROOF STATE]
proof (state)
this:
ereal third_mertens_const = liminf ((\<lambda>n. ereal (real (totient n) * ln (ln (real n)) / real n)) \<circ> primorial')

goal (2 subgoals):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const
 2. ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal third_mertens_const = liminf ((\<lambda>n. ereal (real (totient n) * ln (ln (real n)) / real n)) \<circ> primorial')

goal (2 subgoals):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const
 2. ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))
[PROOF STEP]
have "\<dots> \<ge> liminf (\<lambda>n. totient n * ln (ln n) / n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> liminf ((\<lambda>n. ereal (real (totient n) * ln (ln (real n)) / real n)) \<circ> primorial')
[PROOF STEP]
using strict_mono_primorial'
[PROOF STATE]
proof (prove)
using this:
strict_mono primorial'

goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> liminf ((\<lambda>n. ereal (real (totient n) * ln (ln (real n)) / real n)) \<circ> primorial')
[PROOF STEP]
by (rule liminf_subseq_mono)
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> liminf ((\<lambda>n. ereal (real (totient n) * ln (ln (real n)) / real n)) \<circ> primorial')

goal (2 subgoals):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const
 2. ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const
[PROOF STEP]
show "liminf (\<lambda>n. totient n * ln (ln n) / n) \<le> ?c"
[PROOF STATE]
proof (prove)
using this:
liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const

goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x)) \<le> ereal third_mertens_const

goal (1 subgoal):
 1. ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))
[PROOF STEP]
show "liminf (\<lambda>n. totient n * ln (ln n) / n) \<ge> ?c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))
[PROOF STEP]
unfolding le_Liminf_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y<ereal third_mertens_const. \<forall>\<^sub>F x in sequentially. y < ereal (real (totient x) * ln (ln (real x)) / real x)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y < ereal third_mertens_const \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < ereal (real (totient x) * ln (ln (real x)) / real x)
[PROOF STEP]
fix C'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y < ereal third_mertens_const \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < ereal (real (totient x) * ln (ln (real x)) / real x)
[PROOF STEP]
assume "C' < ereal ?c"
[PROOF STATE]
proof (state)
this:
C' < ereal third_mertens_const

goal (1 subgoal):
 1. \<And>y. y < ereal third_mertens_const \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < ereal (real (totient x) * ln (ln (real x)) / real x)
[PROOF STEP]
from ereal_dense2[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. C' < ereal z \<and> ereal z < ereal third_mertens_const
[PROOF STEP]
obtain C where C: "C < ?c" "ereal C > C'"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. C' < ereal z \<and> ereal z < ereal third_mertens_const

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>C < third_mertens_const; C' < ereal C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C < third_mertens_const
C' < ereal C

goal (1 subgoal):
 1. \<And>y. y < ereal third_mertens_const \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < ereal (real (totient x) * ln (ln (real x)) / real x)
[PROOF STEP]
define \<epsilon> where "\<epsilon> = 1 - C / ?c"
[PROOF STATE]
proof (state)
this:
\<epsilon> = 1 - C / third_mertens_const

goal (1 subgoal):
 1. \<And>y. y < ereal third_mertens_const \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < ereal (real (totient x) * ln (ln (real x)) / real x)
[PROOF STEP]
from C
[PROOF STATE]
proof (chain)
picking this:
C < third_mertens_const
C' < ereal C
[PROOF STEP]
have "\<epsilon> > 0"
[PROOF STATE]
proof (prove)
using this:
C < third_mertens_const
C' < ereal C

goal (1 subgoal):
 1. 0 < \<epsilon>
[PROOF STEP]
using third_mertens_const_pos
[PROOF STATE]
proof (prove)
using this:
C < third_mertens_const
C' < ereal C
0 < third_mertens_const

goal (1 subgoal):
 1. 0 < \<epsilon>
[PROOF STEP]
by (simp add: \<epsilon>_def)
[PROOF STATE]
proof (state)
this:
0 < \<epsilon>

goal (1 subgoal):
 1. \<And>y. y < ereal third_mertens_const \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < ereal (real (totient x) * ln (ln (real x)) / real x)
[PROOF STEP]
have "eventually (\<lambda>n::nat. ln (ln n) > 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < ln (ln (real n))
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < ln (ln (real n))

goal (1 subgoal):
 1. \<And>y. y < ereal third_mertens_const \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < ereal (real (totient x) * ln (ln (real x)) / real x)
[PROOF STEP]
hence "eventually (\<lambda>n. totient n * ln (ln n) / n > C) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < ln (ln (real n))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. C < real (totient n) * ln (ln (real n)) / real n
[PROOF STEP]
using totient_lower_bound[OF \<open>\<epsilon> > 0\<close>] eventually_gt_at_top[of 1]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < ln (ln (real n))
\<forall>\<^sub>F n in sequentially. (1 - \<epsilon>) * third_mertens_const * real n / ln (ln (real n)) < real (totient n)
eventually ((<) (1::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. C < real (totient n) * ln (ln (real n)) / real n
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); (1 - \<epsilon>) * third_mertens_const * real n / ln (ln (real n)) < real (totient n); 1 < n\<rbrakk> \<Longrightarrow> C < real (totient n) * ln (ln (real n)) / real n
[PROOF STEP]
case (elim n)
[PROOF STATE]
proof (state)
this:
0 < ln (ln (real n))
(1 - \<epsilon>) * third_mertens_const * real n / ln (ln (real n)) < real (totient n)
1 < n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); (1 - \<epsilon>) * third_mertens_const * real n / ln (ln (real n)) < real (totient n); 1 < n\<rbrakk> \<Longrightarrow> C < real (totient n) * ln (ln (real n)) / real n
[PROOF STEP]
hence "totient n * ln (ln n) / n > (1 - \<epsilon>) * ?c"
[PROOF STATE]
proof (prove)
using this:
0 < ln (ln (real n))
(1 - \<epsilon>) * third_mertens_const * real n / ln (ln (real n)) < real (totient n)
1 < n

goal (1 subgoal):
 1. (1 - \<epsilon>) * third_mertens_const < real (totient n) * ln (ln (real n)) / real n
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(1 - \<epsilon>) * third_mertens_const < real (totient n) * ln (ln (real n)) / real n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); (1 - \<epsilon>) * third_mertens_const * real n / ln (ln (real n)) < real (totient n); 1 < n\<rbrakk> \<Longrightarrow> C < real (totient n) * ln (ln (real n)) / real n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 - \<epsilon>) * third_mertens_const < real (totient n) * ln (ln (real n)) / real n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); (1 - \<epsilon>) * third_mertens_const * real n / ln (ln (real n)) < real (totient n); 1 < n\<rbrakk> \<Longrightarrow> C < real (totient n) * ln (ln (real n)) / real n
[PROOF STEP]
have "(1 - \<epsilon>) * ?c = C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - \<epsilon>) * third_mertens_const = C
[PROOF STEP]
using third_mertens_const_pos
[PROOF STATE]
proof (prove)
using this:
0 < third_mertens_const

goal (1 subgoal):
 1. (1 - \<epsilon>) * third_mertens_const = C
[PROOF STEP]
by (simp add: field_simps \<epsilon>_def)
[PROOF STATE]
proof (state)
this:
(1 - \<epsilon>) * third_mertens_const = C

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < ln (ln (real n)); (1 - \<epsilon>) * third_mertens_const * real n / ln (ln (real n)) < real (totient n); 1 < n\<rbrakk> \<Longrightarrow> C < real (totient n) * ln (ln (real n)) / real n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
C < real (totient n) * ln (ln (real n)) / real n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
C < real (totient n) * ln (ln (real n)) / real n

goal (1 subgoal):
 1. C < real (totient n) * ln (ln (real n)) / real n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
C < real (totient n) * ln (ln (real n)) / real n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. C < real (totient n) * ln (ln (real n)) / real n

goal (1 subgoal):
 1. \<And>y. y < ereal third_mertens_const \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < ereal (real (totient x) * ln (ln (real x)) / real x)
[PROOF STEP]
thus "eventually (\<lambda>n. ereal (totient n * ln (ln n) / n) > C') at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. C < real (totient n) * ln (ln (real n)) / real n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. C' < ereal (real (totient n) * ln (ln (real n)) / real n)
[PROOF STEP]
by eventually_elim (rule less_trans[OF C(2)], auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. C' < ereal (real (totient n) * ln (ln (real n)) / real n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ereal third_mertens_const \<le> liminf (\<lambda>x. ereal (real (totient x) * ln (ln (real x)) / real x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_closure_norm_le:
  fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
  assumes "continuous_on (closure s) f"
    and "\<forall>y \<in> s. norm(f y) \<le> b"
    and "x \<in> (closure s)"
  shows "norm (f x) \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x) \<le> b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (f x) \<le> b
[PROOF STEP]
have *: "f ` s \<subseteq> cball 0 b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` s \<subseteq> cball (0::'b) b
[PROOF STEP]
using assms(2)[unfolded mem_cball_0[symmetric]]
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>s. f y \<in> cball (0::'b) b

goal (1 subgoal):
 1. f ` s \<subseteq> cball (0::'b) b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` s \<subseteq> cball (0::'b) b

goal (1 subgoal):
 1. norm (f x) \<le> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x) \<le> b
[PROOF STEP]
by (meson "*" assms(1) assms(3) closed_cball image_closure_subset image_subset_iff mem_cball_0)
[PROOF STATE]
proof (state)
this:
norm (f x) \<le> b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma std_normal_distribution_odd_moments_abs:
  fixes k :: nat
  shows "(LINT x|std_normal_distribution. \<bar>x\<bar>^(2 * k + 1)) = sqrt (2 / pi) * 2 ^ k * fact k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|std_normal_distribution. \<bar>x\<bar> ^ (2 * k + 1) = sqrt (2 / pi) * 2 ^ k * fact k
[PROOF STEP]
using integral_std_normal_moment_abs_odd[of k]
[PROOF STATE]
proof (prove)
using this:
LBINT x. std_normal_density x * \<bar>x\<bar> ^ (2 * k + 1) = sqrt (2 / pi) * 2 ^ k * fact k

goal (1 subgoal):
 1. LINT x|std_normal_distribution. \<bar>x\<bar> ^ (2 * k + 1) = sqrt (2 / pi) * 2 ^ k * fact k
[PROOF STEP]
by (subst integral_density) (auto simp: normal_density_nonneg)


[STATEMENT]
lemma sum_of_index_diff [simp]:
  fixes f:: "nat \<Rightarrow> 'a::comm_monoid_add"
  shows "(\<Sum>i\<in>{a..<a+b}. f(i-a)) = (\<Sum>i\<in>{..<b}. f(i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = a..<a + b. f (i - a)) = sum f {..<b}
[PROOF STEP]
proof (induction b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Sum>i = a..<a + 0. f (i - a)) = sum f {..<0}
 2. \<And>b. (\<Sum>i = a..<a + b. f (i - a)) = sum f {..<b} \<Longrightarrow> (\<Sum>i = a..<a + Suc b. f (i - a)) = sum f {..<Suc b}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<Sum>i = a..<a + 0. f (i - a)) = sum f {..<0}
 2. \<And>b. (\<Sum>i = a..<a + b. f (i - a)) = sum f {..<b} \<Longrightarrow> (\<Sum>i = a..<a + Suc b. f (i - a)) = sum f {..<Suc b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = a..<a + 0. f (i - a)) = sum f {..<0}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i = a..<a + 0. f (i - a)) = sum f {..<0}

goal (1 subgoal):
 1. \<And>b. (\<Sum>i = a..<a + b. f (i - a)) = sum f {..<b} \<Longrightarrow> (\<Sum>i = a..<a + Suc b. f (i - a)) = sum f {..<Suc b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. (\<Sum>i = a..<a + b. f (i - a)) = sum f {..<b} \<Longrightarrow> (\<Sum>i = a..<a + Suc b. f (i - a)) = sum f {..<Suc b}
[PROOF STEP]
case (Suc b)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = a..<a + b. f (i - a)) = sum f {..<b}

goal (1 subgoal):
 1. \<And>b. (\<Sum>i = a..<a + b. f (i - a)) = sum f {..<b} \<Longrightarrow> (\<Sum>i = a..<a + Suc b. f (i - a)) = sum f {..<Suc b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = a..<a + b. f (i - a)) = sum f {..<b}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = a..<a + b. f (i - a)) = sum f {..<b}

goal (1 subgoal):
 1. (\<Sum>i = a..<a + Suc b. f (i - a)) = sum f {..<Suc b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i = a..<a + Suc b. f (i - a)) = sum f {..<Suc b}

goal:
No subgoals!
[PROOF STEP]
qed


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


[STATEMENT]
theorem zeta_neg_of_nat:
  "zeta (-of_nat n) = -of_real (bernoulli' (Suc n)) / of_nat (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zeta (- of_nat n) = - complex_of_real (bernoulli' (Suc n)) / of_nat (Suc n)
[PROOF STEP]
unfolding zeta_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hurwitz_zeta 1 (- of_nat n) = - complex_of_real (bernoulli' (Suc n)) / of_nat (Suc n)
[PROOF STEP]
by (simp add: hurwitz_zeta_neg_of_nat bernpoly_1')


[STATEMENT]
lemma mat_of_vec_mult_one_dim_vec:
  fixes a b :: "'a::conjugatable_field vec"
  assumes a: "a \<in> carrier_vec d"
  shows "mat d 1 (\<lambda>(i, j). a $ i) *\<^sub>v vec 1 (\<lambda>k. c) = c \<cdot>\<^sub>v a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat d 1 (\<lambda>(i, j). a $ i) *\<^sub>v vec 1 (\<lambda>k. c) = c \<cdot>\<^sub>v a
[PROOF STEP]
apply (rule eq_vecI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (c \<cdot>\<^sub>v a) \<Longrightarrow> (mat d 1 (\<lambda>(i, j). a $ i) *\<^sub>v vec 1 (\<lambda>k. c)) $ i = (c \<cdot>\<^sub>v a) $ i
 2. dim_vec (mat d 1 (\<lambda>(i, j). a $ i) *\<^sub>v vec 1 (\<lambda>k. c)) = dim_vec (c \<cdot>\<^sub>v a)
[PROOF STEP]
by (auto simp add: scalar_prod_def carrier_vecD[OF a])


[STATEMENT]
lemma card_fPow: "card (Pow (fset A)) = 2 ^ card (fset A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (Pow (fset A)) = 2 ^ card (fset A)
[PROOF STEP]
using card_Pow[of "fset A"]
[PROOF STATE]
proof (prove)
using this:
finite (fset A) \<Longrightarrow> card (Pow (fset A)) = 2 ^ card (fset A)

goal (1 subgoal):
 1. card (Pow (fset A)) = 2 ^ card (fset A)
[PROOF STEP]
by simp


[STATEMENT]
lemma has_derivative_at':
  "(f has_derivative f') (at x)
   \<longleftrightarrow> bounded_linear f' \<and>
       (\<forall>e>0. \<exists>d>0. \<forall>x'. 0 < norm (x' - x) \<and> norm (x' - x) < d \<longrightarrow>
        norm (f x' - f x - f'(x' - x)) / norm (x' - x) < e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_derivative f') (at x) = (bounded_linear f' \<and> (\<forall>e>0. \<exists>d>0. \<forall>x'. 0 < norm (x' - x) \<and> norm (x' - x) < d \<longrightarrow> norm (f x' - f x - f' (x' - x)) / norm (x' - x) < e))
[PROOF STEP]
using has_derivative_within' [of f f' x UNIV]
[PROOF STATE]
proof (prove)
using this:
(f has_derivative f') (at x) = (bounded_linear f' \<and> (\<forall>e>0. \<exists>d>0. \<forall>x'\<in>UNIV. 0 < norm (x' - x) \<and> norm (x' - x) < d \<longrightarrow> norm (f x' - f x - f' (x' - x)) / norm (x' - x) < e))

goal (1 subgoal):
 1. (f has_derivative f') (at x) = (bounded_linear f' \<and> (\<forall>e>0. \<exists>d>0. \<forall>x'. 0 < norm (x' - x) \<and> norm (x' - x) < d \<longrightarrow> norm (f x' - f x - f' (x' - x)) / norm (x' - x) < e))
[PROOF STEP]
by simp


[STATEMENT]
lemma powr_less_mono':
  assumes "(x::real) > 0" "x < 1" "a < b"
  shows   "x powr b < x powr a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powr b < x powr a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x powr b < x powr a
[PROOF STEP]
have "inverse x powr a < inverse x powr b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse x powr a < inverse x powr b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x
x < 1
a < b

goal (1 subgoal):
 1. inverse x powr a < inverse x powr b
[PROOF STEP]
by (intro powr_less_mono) (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
inverse x powr a < inverse x powr b

goal (1 subgoal):
 1. x powr b < x powr a
[PROOF STEP]
hence "inverse (x powr a) < inverse (x powr b)"
[PROOF STATE]
proof (prove)
using this:
inverse x powr a < inverse x powr b

goal (1 subgoal):
 1. inverse (x powr a) < inverse (x powr b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inverse x powr a < inverse x powr b
0 < x
x < 1
a < b

goal (1 subgoal):
 1. inverse (x powr a) < inverse (x powr b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inverse (x powr a) < inverse (x powr b)

goal (1 subgoal):
 1. x powr b < x powr a
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < x
x < 1
a < b
inverse (x powr a) < inverse (x powr b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < x
x < 1
a < b
inverse (x powr a) < inverse (x powr b)

goal (1 subgoal):
 1. x powr b < x powr a
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
x powr b < x powr a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma primorial_ge: "primorial x \<ge> 2 powr primes_pi x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 powr primes_pi x \<le> real (primorial x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 powr primes_pi x \<le> real (primorial x)
[PROOF STEP]
have "2 powr primes_pi x = real (\<Prod>p | prime p \<and> real p \<le> x. 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 powr primes_pi x = real (\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 2)
[PROOF STEP]
by (simp add: primes_pi_def prime_sum_upto_def powr_realpow)
[PROOF STATE]
proof (state)
this:
2 powr primes_pi x = real (\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 2)

goal (1 subgoal):
 1. 2 powr primes_pi x \<le> real (primorial x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 powr primes_pi x = real (\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 2)

goal (1 subgoal):
 1. 2 powr primes_pi x \<le> real (primorial x)
[PROOF STEP]
have "(\<Prod>p | prime p \<and> real p \<le> x. 2) \<le> (\<Prod>p | prime p \<and> real p \<le> x. p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 2) \<le> \<Prod>{p. prime p \<and> real p \<le> x}
[PROOF STEP]
by (intro prod_mono) (auto dest: prime_gt_1_nat)
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 2) \<le> \<Prod>{p. prime p \<and> real p \<le> x}

goal (1 subgoal):
 1. 2 powr primes_pi x \<le> real (primorial x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>{p. prime p \<and> real p \<le> x}. 2) \<le> \<Prod>{p. prime p \<and> real p \<le> x}

goal (1 subgoal):
 1. 2 powr primes_pi x \<le> real (primorial x)
[PROOF STEP]
have "\<dots> = primorial x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>{p. prime p \<and> real p \<le> x} = primorial x
[PROOF STEP]
by (simp add: primorial_def)
[PROOF STATE]
proof (state)
this:
\<Prod>{p. prime p \<and> real p \<le> x} = primorial x

goal (1 subgoal):
 1. 2 powr primes_pi x \<le> real (primorial x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> real x \<le> real y) \<Longrightarrow> 2 powr primes_pi x \<le> real (primorial x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> real x \<le> real y) \<Longrightarrow> 2 powr primes_pi x \<le> real (primorial x)

goal (1 subgoal):
 1. 2 powr primes_pi x \<le> real (primorial x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 powr primes_pi x \<le> real (primorial x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gbinomial_factors: "((a + 1) gchoose (Suc k)) = (a + 1) / of_nat (Suc k) * (a gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
proof (cases k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
 2. \<And>nat. k = Suc nat \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
k = 0

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
 2. \<And>nat. k = Suc nat \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k = 0

goal (1 subgoal):
 1. a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
case (Suc b)
[PROOF STATE]
proof (state)
this:
k = Suc b

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = Suc b
[PROOF STEP]
have "((a + 1) gchoose (Suc (Suc b))) = (\<Prod>i = 0 .. Suc b. a + (1 - of_nat i)) / fact (b + 2)"
[PROOF STATE]
proof (prove)
using this:
k = Suc b

goal (1 subgoal):
 1. a + (1::'a) gchoose Suc (Suc b) = (\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) / fact (b + 2)
[PROOF STEP]
by (simp add: field_simps gbinomial_prod_rev atLeastLessThanSuc_atLeastAtMost)
[PROOF STATE]
proof (state)
this:
a + (1::'a) gchoose Suc (Suc b) = (\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) / fact (b + 2)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a + (1::'a) gchoose Suc (Suc b) = (\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) / fact (b + 2)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
have "(\<Prod>i = 0 .. Suc b. a + (1 - of_nat i)) = (a + 1) * (\<Prod>i = 0..b. a - of_nat i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) = (a + (1::'a)) * (\<Prod>i = 0..b. a - of_nat i)
[PROOF STEP]
by (simp add: prod.atLeast0_atMost_Suc_shift del: prod.cl_ivl_Suc)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) = (a + (1::'a)) * (\<Prod>i = 0..b. a - of_nat i)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) = (a + (1::'a)) * (\<Prod>i = 0..b. a - of_nat i)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
have "\<dots> / fact (b + 2) = (a + 1) / of_nat (Suc (Suc b)) * (a gchoose Suc b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + (1::'a)) * (\<Prod>i = 0..b. a - of_nat i) / fact (b + 2) = (a + (1::'a)) / of_nat (Suc (Suc b)) * (a gchoose Suc b)
[PROOF STEP]
by (simp_all add: gbinomial_prod_rev atLeastLessThanSuc_atLeastAtMost atLeast0AtMost)
[PROOF STATE]
proof (state)
this:
(a + (1::'a)) * (\<Prod>i = 0..b. a - of_nat i) / fact (b + 2) = (a + (1::'a)) / of_nat (Suc (Suc b)) * (a gchoose Suc b)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a + (1::'a) gchoose Suc (Suc b) = (a + (1::'a)) / of_nat (Suc (Suc b)) * (a gchoose Suc b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a + (1::'a) gchoose Suc (Suc b) = (a + (1::'a)) / of_nat (Suc (Suc b)) * (a gchoose Suc b)

goal (1 subgoal):
 1. a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)
[PROOF STEP]
by (simp add: Suc)
[PROOF STATE]
proof (state)
this:
a + (1::'a) gchoose Suc k = (a + (1::'a)) / of_nat (Suc k) * (a gchoose k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mods_with_nats:
  assumes "(v::nat) > w"
    and "(v * b) mod a = (w * b) mod a"
  shows "((v - w) * b) mod a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v - w) * b mod a = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
w < v
v * b mod a = w * b mod a

goal (1 subgoal):
 1. (v - w) * b mod a = 0
[PROOF STEP]
by (simp add: mod_eq_dvd_iff_nat algebra_simps)

\<comment> \<open>The 0-vector of length \<open>n\<close>.\<close>


[STATEMENT]
lemma Re_less_pihalf_lemma:
  assumes "\<bar>Re z\<bar> < pi / 2"
    shows "0 < Re ((exp (\<i>*z) + inverse (exp (\<i>*z))) / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < Re ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)
[PROOF STEP]
have "0 < cos (Re z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < cos (Re z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<bar>Re z\<bar> < pi / 2

goal (1 subgoal):
 1. 0 < cos (Re z)
[PROOF STEP]
using cos_gt_zero_pi
[PROOF STATE]
proof (prove)
using this:
\<bar>Re z\<bar> < pi / 2
\<lbrakk>- (pi / 2) < ?x; ?x < pi / 2\<rbrakk> \<Longrightarrow> 0 < cos ?x

goal (1 subgoal):
 1. 0 < cos (Re z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < cos (Re z)

goal (1 subgoal):
 1. 0 < Re ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < cos (Re z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < cos (Re z)

goal (1 subgoal):
 1. 0 < Re ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)
[PROOF STEP]
by (simp add: cos_i_times [symmetric] Re_cos Im_cos add_pos_pos)
[PROOF STATE]
proof (state)
this:
0 < Re ((exp (\<i> * z) + inverse (exp (\<i> * z))) / 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonzero_inverse_mult_distrib:
  assumes "a \<in> carrier R" "b \<in> carrier R"
    and "a \<noteq> \<zero>" "b \<noteq> \<zero>"
  shows "inv (a \<otimes> b) = inv b \<otimes> inv a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (a \<otimes> b) = inv b \<otimes> inv a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv (a \<otimes> b) = inv b \<otimes> inv a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier R
b \<in> carrier R
a \<noteq> \<zero>
b \<noteq> \<zero>
[PROOF STEP]
have "a \<otimes> (b \<otimes> inv b) \<otimes> inv a = \<one>"
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
b \<in> carrier R
a \<noteq> \<zero>
b \<noteq> \<zero>

goal (1 subgoal):
 1. a \<otimes> (b \<otimes> inv b) \<otimes> inv a = \<one>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<otimes> (b \<otimes> inv b) \<otimes> inv a = \<one>

goal (1 subgoal):
 1. inv (a \<otimes> b) = inv b \<otimes> inv a
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier R
b \<in> carrier R
a \<noteq> \<zero>
b \<noteq> \<zero>
a \<otimes> (b \<otimes> inv b) \<otimes> inv a = \<one>
[PROOF STEP]
have eq: "a \<otimes> b \<otimes> (inv b \<otimes> inv a) = \<one>"
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
b \<in> carrier R
a \<noteq> \<zero>
b \<noteq> \<zero>
a \<otimes> (b \<otimes> inv b) \<otimes> inv a = \<one>

goal (1 subgoal):
 1. a \<otimes> b \<otimes> (inv b \<otimes> inv a) = \<one>
[PROOF STEP]
by (simp only: m_assoc m_closed inv_closed assms)
[PROOF STATE]
proof (state)
this:
a \<otimes> b \<otimes> (inv b \<otimes> inv a) = \<one>

goal (1 subgoal):
 1. inv (a \<otimes> b) = inv b \<otimes> inv a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier R
b \<in> carrier R
a \<noteq> \<zero>
b \<noteq> \<zero>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
b \<in> carrier R
a \<noteq> \<zero>
b \<noteq> \<zero>

goal (1 subgoal):
 1. inv (a \<otimes> b) = inv b \<otimes> inv a
[PROOF STEP]
using inverse_unique [OF _ _ eq]
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
b \<in> carrier R
a \<noteq> \<zero>
b \<noteq> \<zero>
\<lbrakk>a \<otimes> b \<in> carrier R; inv b \<otimes> inv a \<in> carrier R\<rbrakk> \<Longrightarrow> inv (a \<otimes> b) = inv b \<otimes> inv a

goal (1 subgoal):
 1. inv (a \<otimes> b) = inv b \<otimes> inv a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inv (a \<otimes> b) = inv b \<otimes> inv a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_field_derivative_iff:
  "(f has_field_derivative D) (at x within S) \<longleftrightarrow>
    ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative D) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_field_derivative D) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)
[PROOF STEP]
have "((\<lambda>y. norm (f y - f x - D * (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within S)
      = ((\<lambda>y. (f y - f x) / (y - x) - D) \<longlongrightarrow> 0) (at x within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. norm (f y - f x - D * (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x) - D) \<longlongrightarrow> (0::'a)) (at x within S)
[PROOF STEP]
by (smt (verit, best) Lim_cong_within divide_diff_eq_iff norm_divide right_minus_eq tendsto_norm_zero_iff)
[PROOF STATE]
proof (state)
this:
((\<lambda>y. norm (f y - f x - D * (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x) - D) \<longlongrightarrow> (0::'a)) (at x within S)

goal (1 subgoal):
 1. (f has_field_derivative D) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>y. norm (f y - f x - D * (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x) - D) \<longlongrightarrow> (0::'a)) (at x within S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>y. norm (f y - f x - D * (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x) - D) \<longlongrightarrow> (0::'a)) (at x within S)

goal (1 subgoal):
 1. (f has_field_derivative D) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)
[PROOF STEP]
by (simp add: has_field_derivative_def has_derivative_iff_norm bounded_linear_mult_right LIM_zero_iff)
[PROOF STATE]
proof (state)
this:
(f has_field_derivative D) (at x within S) = ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> D) (at x within S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_ceiling_eq:
  fixes f::"'a \<Rightarrow> 'b::{order_topology,floor_ceiling}"
  assumes f: "(f \<longlongrightarrow> l) F"
    and l: "l \<notin> \<int>"
  shows "\<forall>\<^sub>F x in F. ceiling (f x) = ceiling l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<lceil>f x\<rceil> = \<lceil>l\<rceil>
[PROOF STEP]
using eventually_floor_less[OF assms] eventually_less_ceiling[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. of_int \<lfloor>l\<rfloor> < f x
\<forall>\<^sub>F x in F. f x < of_int \<lceil>l\<rceil>

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<lceil>f x\<rceil> = \<lceil>l\<rceil>
[PROOF STEP]
by eventually_elim (meson floor_less_iff less_ceiling_iff not_less_iff_gr_or_eq)


[STATEMENT]
lemma effective_scalar_product_append:
assumes "length zs = length ws" and  "(length xs = length ys)"
 shows "(scalar_product (xs@zs) (ys@ws)) = (scalar_product xs ys)+(scalar_product zs ws)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scalar_product (xs @ zs) (ys @ ws) = scalar_product xs ys + scalar_product zs ws
[PROOF STEP]
using scalar_product_append assms
[PROOF STATE]
proof (prove)
using this:
\<forall>xs ys zs ws. length zs = length ws \<and> length xs = length ys \<and> length xs = ?n \<longrightarrow> scalar_product (xs @ zs) (ys @ ws) = scalar_product xs ys + scalar_product zs ws
length zs = length ws
length xs = length ys

goal (1 subgoal):
 1. scalar_product (xs @ zs) (ys @ ws) = scalar_product xs ys + scalar_product zs ws
[PROOF STEP]
by auto


[STATEMENT]
lemma Example2_lemma2_aux: "!!b. j<n \<Longrightarrow>
 (\<Sum>i=0..<n. (b i::nat)) =
 (\<Sum>i=0..<j. b i) + b j + (\<Sum>i=0..<n-(Suc j) . b (Suc j + i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. j < n \<Longrightarrow> sum b {0..<n} = sum b {0..<j} + b j + (\<Sum>i = 0..<n - Suc j. b (Suc j + i))
[PROOF STEP]
apply(induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b. j < 0 \<Longrightarrow> sum b {0..<0} = sum b {0..<j} + b j + (\<Sum>i = 0..<0 - Suc j. b (Suc j + i))
 2. \<And>n b. \<lbrakk>\<And>b. j < n \<Longrightarrow> sum b {0..<n} = sum b {0..<j} + b j + (\<Sum>i = 0..<n - Suc j. b (Suc j + i)); j < Suc n\<rbrakk> \<Longrightarrow> sum b {0..<Suc n} = sum b {0..<j} + b j + (\<Sum>i = 0..<Suc n - Suc j. b (Suc j + i))
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n b. \<lbrakk>\<And>b. j < n \<Longrightarrow> sum b {0..<n} = sum b {0..<j} + b j + (\<Sum>i = 0..<n - Suc j. b (Suc (j + i))); j < Suc n\<rbrakk> \<Longrightarrow> sum b {0..<n} + b n = sum b {0..<j} + b j + (\<Sum>i = 0..<n - j. b (Suc (j + i)))
[PROOF STEP]
apply(simp add:less_Suc_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n b. \<lbrakk>\<And>b. j < n \<Longrightarrow> sum b {0..<n} = sum b {0..<j} + b j + (\<Sum>i = 0..<n - Suc j. b (Suc (j + i))); j < n \<or> j = n\<rbrakk> \<Longrightarrow> sum b {0..<n} + b n = sum b {0..<j} + b j + (\<Sum>i = 0..<n - j. b (Suc (j + i)))
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n b. \<lbrakk>\<And>b. sum b {0..<n} = sum b {0..<j} + b j + (\<Sum>i = 0..<n - Suc j. b (Suc (j + i))); j < n\<rbrakk> \<Longrightarrow> (\<Sum>i = 0..<n - Suc j. b (Suc (j + i))) + b n = (\<Sum>i = 0..<n - j. b (Suc (j + i)))
[PROOF STEP]
apply(subgoal_tac "n - j = Suc(n- Suc j)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n b. \<lbrakk>\<And>b. sum b {0..<n} = sum b {0..<j} + b j + (\<Sum>i = 0..<n - Suc j. b (Suc (j + i))); j < n; n - j = Suc (n - Suc j)\<rbrakk> \<Longrightarrow> (\<Sum>i = 0..<n - Suc j. b (Suc (j + i))) + b n = (\<Sum>i = 0..<n - j. b (Suc (j + i)))
 2. \<And>n b. \<lbrakk>\<And>b. sum b {0..<n} = sum b {0..<j} + b j + (\<Sum>i = 0..<n - Suc j. b (Suc (j + i))); j < n\<rbrakk> \<Longrightarrow> n - j = Suc (n - Suc j)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n b. \<lbrakk>\<And>b. sum b {0..<n} = sum b {0..<j} + b j + (\<Sum>i = 0..<n - Suc j. b (Suc (j + i))); j < n\<rbrakk> \<Longrightarrow> n - j = Suc (n - Suc j)
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem euler_product_zeta:
  assumes "Re s > 1"
  shows   "(\<lambda>n. \<Prod>p\<le>n. if prime p then inverse (1 - 1 / of_nat p powr s) else 1) \<longlonglongrightarrow> zeta s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Prod>p\<le>n. if prime p then inverse (1 - 1 / of_nat p powr s) else 1) \<longlonglongrightarrow> zeta s
[PROOF STEP]
using euler_product_fds_zeta[of s] assms
[PROOF STATE]
proof (prove)
using this:
1 < s \<bullet> 1 \<Longrightarrow> (\<lambda>n. \<Prod>p\<le>n. if prime p then inverse (1 - 1 / nat_power p s) else 1) \<longlonglongrightarrow> eval_fds fds_zeta s
1 < Re s

goal (1 subgoal):
 1. (\<lambda>n. \<Prod>p\<le>n. if prime p then inverse (1 - 1 / of_nat p powr s) else 1) \<longlonglongrightarrow> zeta s
[PROOF STEP]
unfolding nat_power_complex_def
[PROOF STATE]
proof (prove)
using this:
1 < s \<bullet> 1 \<Longrightarrow> (\<lambda>n. \<Prod>p\<le>n. if prime p then inverse (1 - 1 / of_nat p powr s) else 1) \<longlonglongrightarrow> eval_fds fds_zeta s
1 < Re s

goal (1 subgoal):
 1. (\<lambda>n. \<Prod>p\<le>n. if prime p then inverse (1 - 1 / of_nat p powr s) else 1) \<longlonglongrightarrow> zeta s
[PROOF STEP]
by (simp add: eval_fds_zeta)


[STATEMENT]
lemma  orthogonal_matrix_orthonormal_columns:
  fixes A :: "real^'n^'n"
  shows "orthogonal_matrix A \<longleftrightarrow>
          (\<forall>i. norm(column i A) = 1) \<and>
          (\<forall>i j. i \<noteq> j \<longrightarrow> orthogonal (column i A) (column j A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal_matrix A = ((\<forall>i. norm (column i A) = 1) \<and> (\<forall>i j. i \<noteq> j \<longrightarrow> orthogonal (column i A) (column j A)))
[PROOF STEP]
by (auto simp: orthogonal_matrix matrix_mult_transpose_dot_column vec_eq_iff mat_def norm_eq_1 orthogonal_def)


[STATEMENT]
lemma norm_sin_squared:
  "norm(sin z) ^ 2 = (exp(2 * Im z) + inverse(exp(2 * Im z)) - 2 * cos(2 * Re z)) / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod (sin z))\<^sup>2 = (exp (2 * Im z) + inverse (exp (2 * Im z)) - 2 * cos (2 * Re z)) / 4
[PROOF STEP]
proof (cases z)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x1 x2. z = Complex x1 x2 \<Longrightarrow> (cmod (sin z))\<^sup>2 = (exp (2 * Im z) + inverse (exp (2 * Im z)) - 2 * cos (2 * Re z)) / 4
[PROOF STEP]
case (Complex x1 x2)
[PROOF STATE]
proof (state)
this:
z = Complex x1 x2

goal (1 subgoal):
 1. \<And>x1 x2. z = Complex x1 x2 \<Longrightarrow> (cmod (sin z))\<^sup>2 = (exp (2 * Im z) + inverse (exp (2 * Im z)) - 2 * cos (2 * Re z)) / 4
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = Complex x1 x2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z = Complex x1 x2

goal (1 subgoal):
 1. (cmod (sin z))\<^sup>2 = (exp (2 * Im z) + inverse (exp (2 * Im z)) - 2 * cos (2 * Re z)) / 4
[PROOF STEP]
apply (simp only: sin_add cmod_power2 cos_of_real sin_of_real cos_double_cos exp_double Complex_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z = complex_of_real x1 + \<i> * complex_of_real x2 \<Longrightarrow> (Re (complex_of_real (sin x1) * cos (\<i> * complex_of_real x2) + complex_of_real (cos x1) * sin (\<i> * complex_of_real x2)))\<^sup>2 + (Im (complex_of_real (sin x1) * cos (\<i> * complex_of_real x2) + complex_of_real (cos x1) * sin (\<i> * complex_of_real x2)))\<^sup>2 = ((exp (Im (complex_of_real x1 + \<i> * complex_of_real x2)))\<^sup>2 + inverse ((exp (Im (complex_of_real x1 + \<i> * complex_of_real x2)))\<^sup>2) - 2 * (2 * (cos (Re (complex_of_real x1 + \<i> * complex_of_real x2)))\<^sup>2 - 1)) / 4
[PROOF STEP]
apply (simp add: cos_exp_eq sin_exp_eq exp_minus exp_of_real Re_divide Im_divide power_divide)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z = complex_of_real x1 + \<i> * complex_of_real x2 \<Longrightarrow> (sin x1 * (exp x2 / (exp x2)\<^sup>2 + exp x2))\<^sup>2 + (cos x1 * (exp x2 / (exp x2)\<^sup>2 - exp x2))\<^sup>2 = (exp x2)\<^sup>2 + inverse ((exp x2)\<^sup>2) - (4 * (cos x1)\<^sup>2 - 2)
[PROOF STEP]
apply (simp only: left_diff_distrib [symmetric] power_mult_distrib cos_squared_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z = complex_of_real x1 + \<i> * complex_of_real x2 \<Longrightarrow> (sin x1)\<^sup>2 * (exp x2 / (exp x2)\<^sup>2 + exp x2)\<^sup>2 + (1 - (sin x1)\<^sup>2) * (exp x2 / (exp x2)\<^sup>2 - exp x2)\<^sup>2 = (exp x2)\<^sup>2 + inverse ((exp x2)\<^sup>2) - (4 * (1 - (sin x1)\<^sup>2) - 2)
[PROOF STEP]
apply (simp add: power2_eq_square field_split_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(cmod (sin z))\<^sup>2 = (exp (2 * Im z) + inverse (exp (2 * Im z)) - 2 * cos (2 * Re z)) / 4

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma law_of_cosines:
  shows "(cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2*(cdist A C)*(cdist A B)*(cos (\<angle> (C-A) (B-A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))
[PROOF STEP]
let ?a = "C-B" and ?b = "C-A" and ?c = "B-A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))
[PROOF STEP]
have "?a = ?b - ?c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C - B = C - A - (B - A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
C - B = C - A - (B - A)

goal (1 subgoal):
 1. (cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))
[PROOF STEP]
hence "(cmod ?a)\<^sup>2 = (cmod (?b - ?c))\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
C - B = C - A - (B - A)

goal (1 subgoal):
 1. (cmod (C - B))\<^sup>2 = (cmod (C - A - (B - A)))\<^sup>2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(cmod (C - B))\<^sup>2 = (cmod (C - A - (B - A)))\<^sup>2

goal (1 subgoal):
 1. (cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(cmod (C - B))\<^sup>2 = (cmod (C - A - (B - A)))\<^sup>2

goal (1 subgoal):
 1. (cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))
[PROOF STEP]
have "... = Re (scalprod (?b-?c) (?b-?c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod (C - A - (B - A)))\<^sup>2 = Re (scalprod (C - A - (B - A)) (C - A - (B - A)))
[PROOF STEP]
by (simp add: cmod_square)
[PROOF STATE]
proof (state)
this:
(cmod (C - A - (B - A)))\<^sup>2 = Re (scalprod (C - A - (B - A)) (C - A - (B - A)))

goal (1 subgoal):
 1. (cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(cmod (C - A - (B - A)))\<^sup>2 = Re (scalprod (C - A - (B - A)) (C - A - (B - A)))

goal (1 subgoal):
 1. (cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))
[PROOF STEP]
have "... = (cmod ?b)\<^sup>2 + (cmod ?c)\<^sup>2 - 2*Re (scalprod ?b ?c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (scalprod (C - A - (B - A)) (C - A - (B - A))) = (cmod (C - A))\<^sup>2 + (cmod (B - A))\<^sup>2 - 2 * Re (scalprod (C - A) (B - A))
[PROOF STEP]
by (simp add: cmod_square field_simps)
[PROOF STATE]
proof (state)
this:
Re (scalprod (C - A - (B - A)) (C - A - (B - A))) = (cmod (C - A))\<^sup>2 + (cmod (B - A))\<^sup>2 - 2 * Re (scalprod (C - A) (B - A))

goal (1 subgoal):
 1. (cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(cmod (C - B))\<^sup>2 = (cmod (C - A))\<^sup>2 + (cmod (B - A))\<^sup>2 - 2 * Re (scalprod (C - A) (B - A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(cmod (C - B))\<^sup>2 = (cmod (C - A))\<^sup>2 + (cmod (B - A))\<^sup>2 - 2 * Re (scalprod (C - A) (B - A))

goal (1 subgoal):
 1. (cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))
[PROOF STEP]
using cos_cmod_scalprod[of ?b ?c]
[PROOF STATE]
proof (prove)
using this:
(cmod (C - B))\<^sup>2 = (cmod (C - A))\<^sup>2 + (cmod (B - A))\<^sup>2 - 2 * Re (scalprod (C - A) (B - A))
cmod (C - A) * cmod (B - A) * cos (\<angle> (C - A) (B - A)) = Re (scalprod (C - A) (B - A))

goal (1 subgoal):
 1. (cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(cdist B C)\<^sup>2 = (cdist A C)\<^sup>2 + (cdist A B)\<^sup>2 - 2 * cdist A C * cdist A B * cos (\<angle> (C - A) (B - A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Fourier_sum_offset_Dirichlet_kernel:
  assumes f: "f absolutely_integrable_on {-pi..pi}" and periodic: "\<And>x. f(x + 2*pi) = f x"
  shows
   "(\<Sum>k\<le>2*n. Fourier_coefficient f k * trigonometric_set k t) =
            integral\<^sup>L (lebesgue_on {-pi..pi}) (\<lambda>x. Dirichlet_kernel n x * f(x+t)) / pi"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
have ft: "(\<lambda>x. f(x+t)) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (x + t)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
using absolutely_integrable_periodic_offset [OF f, of t] periodic
[PROOF STATE]
proof (prove)
using this:
(\<And>x. f (x + (pi - - pi)) = f x) \<Longrightarrow> (\<lambda>x. f (x + t)) absolutely_integrable_on {- pi..pi}
(\<And>x. f (x + (pi - - pi)) = f x) \<Longrightarrow> (\<lambda>x. f (t + x)) absolutely_integrable_on {- pi..pi}
f (?x + 2 * pi) = f ?x

goal (1 subgoal):
 1. (\<lambda>x. f (x + t)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (x + t)) absolutely_integrable_on {- pi..pi}

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
have "?lhs = (\<Sum>k=0..n. Fourier_coefficient (\<lambda>x. f(x+t)) (2*k) * trigonometric_set (2*k) 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (\<Sum>k = 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) * trigonometric_set (2 * k) 0)
[PROOF STEP]
using Fourier_sum_offset_unpaired assms atMost_atLeast0
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f absolutely_integrable_on {- pi..pi}; \<And>x. ?f (x + 2 * pi) = ?f x\<rbrakk> \<Longrightarrow> (\<Sum>k\<le>2 * ?n. Fourier_coefficient ?f k * trigonometric_set k ?t) = (\<Sum>k\<le>?n. Fourier_coefficient (\<lambda>x. ?f (x + ?t)) (2 * k) * trigonometric_set (2 * k) 0)
f absolutely_integrable_on {- pi..pi}
f (?x + 2 * pi) = f ?x
{..?n} = {0..?n}

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (\<Sum>k = 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) * trigonometric_set (2 * k) 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (\<Sum>k = 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) * trigonometric_set (2 * k) 0)

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (\<Sum>k = 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) * trigonometric_set (2 * k) 0)

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
have "\<dots> = Fourier_coefficient (\<lambda>x. f(x+t)) 0 / sqrt (2 * pi)
                 + (\<Sum>k = Suc 0..n. Fourier_coefficient (\<lambda>x. f(x+t)) (2*k) / sqrt pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) * trigonometric_set (2 * k) 0) = Fourier_coefficient (\<lambda>x. f (x + t)) 0 / sqrt (2 * pi) + (\<Sum>k = Suc 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) / sqrt pi)
[PROOF STEP]
by (simp add: sum.atLeast_Suc_atMost trigonometric_set_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) * trigonometric_set (2 * k) 0) = Fourier_coefficient (\<lambda>x. f (x + t)) 0 / sqrt (2 * pi) + (\<Sum>k = Suc 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) / sqrt pi)

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) * trigonometric_set (2 * k) 0) = Fourier_coefficient (\<lambda>x. f (x + t)) 0 / sqrt (2 * pi) + (\<Sum>k = Suc 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) / sqrt pi)

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
have "\<dots> = (LINT x|lebesgue_on {-pi..pi}. f(x+t)) / (2 * pi) +
                   (\<Sum>k = Suc 0..n. (LINT x|lebesgue_on {-pi..pi}. cos (real k * x) * f(x+t)) / pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. f (x + t)) 0 / sqrt (2 * pi) + (\<Sum>k = Suc 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) / sqrt pi) = (LINT x|lebesgue_on {- pi..pi}. f (x + t)) / (2 * pi) + (\<Sum>k = Suc 0..n. (LINT x|lebesgue_on {- pi..pi}. cos (real k * x) * f (x + t)) / pi)
[PROOF STEP]
by (simp add: Fourier_coefficient_def orthonormal_coeff_def trigonometric_set_def l2product_def)
[PROOF STATE]
proof (state)
this:
Fourier_coefficient (\<lambda>x. f (x + t)) 0 / sqrt (2 * pi) + (\<Sum>k = Suc 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) / sqrt pi) = (LINT x|lebesgue_on {- pi..pi}. f (x + t)) / (2 * pi) + (\<Sum>k = Suc 0..n. (LINT x|lebesgue_on {- pi..pi}. cos (real k * x) * f (x + t)) / pi)

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Fourier_coefficient (\<lambda>x. f (x + t)) 0 / sqrt (2 * pi) + (\<Sum>k = Suc 0..n. Fourier_coefficient (\<lambda>x. f (x + t)) (2 * k) / sqrt pi) = (LINT x|lebesgue_on {- pi..pi}. f (x + t)) / (2 * pi) + (\<Sum>k = Suc 0..n. (LINT x|lebesgue_on {- pi..pi}. cos (real k * x) * f (x + t)) / pi)

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
have "\<dots> = LINT x|lebesgue_on {-pi..pi}.
                     f(x+t) / (2 * pi) + (\<Sum>k = Suc 0..n. (cos (real k * x) * f(x+t)) / pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|lebesgue_on {- pi..pi}. f (x + t)) / (2 * pi) + (\<Sum>k = Suc 0..n. (LINT x|lebesgue_on {- pi..pi}. cos (real k * x) * f (x + t)) / pi) = LINT x|lebesgue_on {- pi..pi}. f (x + t) / (2 * pi) + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t) / pi)
[PROOF STEP]
using Fourier_products_integrable_cos [OF ft] absolutely_integrable_imp_integrable [OF ft]
[PROOF STATE]
proof (prove)
using this:
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. cos (?k * x) * f (x + t))
{- pi..pi} \<in> sets lebesgue \<Longrightarrow> integrable (lebesgue_on {- pi..pi}) (\<lambda>x. f (x + t))

goal (1 subgoal):
 1. (LINT x|lebesgue_on {- pi..pi}. f (x + t)) / (2 * pi) + (\<Sum>k = Suc 0..n. (LINT x|lebesgue_on {- pi..pi}. cos (real k * x) * f (x + t)) / pi) = LINT x|lebesgue_on {- pi..pi}. f (x + t) / (2 * pi) + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t) / pi)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(LINT x|lebesgue_on {- pi..pi}. f (x + t)) / (2 * pi) + (\<Sum>k = Suc 0..n. (LINT x|lebesgue_on {- pi..pi}. cos (real k * x) * f (x + t)) / pi) = LINT x|lebesgue_on {- pi..pi}. f (x + t) / (2 * pi) + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t) / pi)

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(LINT x|lebesgue_on {- pi..pi}. f (x + t)) / (2 * pi) + (\<Sum>k = Suc 0..n. (LINT x|lebesgue_on {- pi..pi}. cos (real k * x) * f (x + t)) / pi) = LINT x|lebesgue_on {- pi..pi}. f (x + t) / (2 * pi) + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t) / pi)

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
have "\<dots> = (LINT x|lebesgue_on {-pi..pi}.
                     f(x+t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f(x+t))) / pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. f (x + t) / (2 * pi) + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t) / pi) = (LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t))) / pi
[PROOF STEP]
by (simp add: divide_simps sum_distrib_right mult.assoc)
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue_on {- pi..pi}. f (x + t) / (2 * pi) + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t) / pi) = (LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t))) / pi

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue_on {- pi..pi}. f (x + t) / (2 * pi) + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t) / pi) = (LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t))) / pi

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t))) / pi = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t))) / pi = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
have "LINT x|lebesgue_on {-pi..pi}. f(x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f(x + t))
        = LINT x|lebesgue_on {-pi..pi}. Dirichlet_kernel n x * f(x + t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
have eq: "f(x+t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f(x + t))
              = Dirichlet_kernel n x * f(x + t)" if "- pi \<le> x" "x \<le> pi" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
proof (cases "x = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = 0 \<Longrightarrow> f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)
 2. x \<noteq> 0 \<Longrightarrow> f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)
 2. x \<noteq> 0 \<Longrightarrow> f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> 0
[PROOF STEP]
have "sin (x/2) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. sin (x / 2) \<noteq> 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0
- pi \<le> x
x \<le> pi

goal (1 subgoal):
 1. sin (x / 2) \<noteq> 0
[PROOF STEP]
by (auto simp: sin_zero_iff)
[PROOF STATE]
proof (state)
this:
sin (x / 2) \<noteq> 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)
 2. x \<noteq> 0 \<Longrightarrow> f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sin (x / 2) \<noteq> 0
[PROOF STEP]
have "f(x + t) * (1/2 + (\<Sum>k = Suc 0..n. cos(real k * x))) = f(x + t) * sin((real n + 1/2) * x) / 2 / sin(x/2)"
[PROOF STATE]
proof (prove)
using this:
sin (x / 2) \<noteq> 0

goal (1 subgoal):
 1. f (x + t) * (1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))) = f (x + t) * sin ((real n + 1 / 2) * x) / 2 / sin (x / 2)
[PROOF STEP]
using cosine_sum_lemma [of x n]
[PROOF STATE]
proof (prove)
using this:
sin (x / 2) \<noteq> 0
(1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))) * sin (x / 2) = sin ((real n + 1 / 2) * x) / 2

goal (1 subgoal):
 1. f (x + t) * (1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))) = f (x + t) * sin ((real n + 1 / 2) * x) / 2 / sin (x / 2)
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
f (x + t) * (1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))) = f (x + t) * sin ((real n + 1 / 2) * x) / 2 / sin (x / 2)

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)
 2. x \<noteq> 0 \<Longrightarrow> f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f (x + t) * (1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))) = f (x + t) * sin ((real n + 1 / 2) * x) / 2 / sin (x / 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f (x + t) * (1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))) = f (x + t) * sin ((real n + 1 / 2) * x) / 2 / sin (x / 2)

goal (1 subgoal):
 1. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
by (simp add: Dirichlet_kernel_def False field_simps sum_distrib_left)
[PROOF STATE]
proof (state)
this:
f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)

goal (1 subgoal):
 1. x = 0 \<Longrightarrow> f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
qed (simp add: Dirichlet_kernel_def algebra_simps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>- pi \<le> ?x; ?x \<le> pi\<rbrakk> \<Longrightarrow> f (?x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * ?x) * f (?x + t)) = Dirichlet_kernel n ?x * f (?x + t)

goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
by (rule Bochner_Integration.integral_cong [OF refl]) (simp add: eq)
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)

goal (1 subgoal):
 1. (LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t))) / pi = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t)) = LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)

goal (1 subgoal):
 1. (LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t))) / pi = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t))) / pi = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(LINT x|lebesgue_on {- pi..pi}. f (x + t) / 2 + (\<Sum>k = Suc 0..n. cos (real k * x) * f (x + t))) / pi = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi

goal (1 subgoal):
 1. (\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>2 * n. Fourier_coefficient f k * trigonometric_set k t) = (LINT x|lebesgue_on {- pi..pi}. Dirichlet_kernel n x * f (x + t)) / pi

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lcm_gcd_distrib:
  "lcm x (gcd y z) = gcd (lcm x y) (lcm x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm x (gcd y z) = gcd (lcm x y) (lcm x z)
[PROOF STEP]
proof (cases "x = 0 \<or> y = 0 \<or> z = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a) \<Longrightarrow> lcm x (gcd y z) = gcd (lcm x y) (lcm x z)
 2. \<not> (x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a)) \<Longrightarrow> lcm x (gcd y z) = gcd (lcm x y) (lcm x z)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a)

goal (2 subgoals):
 1. x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a) \<Longrightarrow> lcm x (gcd y z) = gcd (lcm x y) (lcm x z)
 2. \<not> (x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a)) \<Longrightarrow> lcm x (gcd y z) = gcd (lcm x y) (lcm x z)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a)

goal (1 subgoal):
 1. lcm x (gcd y z) = gcd (lcm x y) (lcm x z)
[PROOF STEP]
by (auto simp: lcm_proj1_if_dvd lcm_proj2_if_dvd)
[PROOF STATE]
proof (state)
this:
lcm x (gcd y z) = gcd (lcm x y) (lcm x z)

goal (1 subgoal):
 1. \<not> (x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a)) \<Longrightarrow> lcm x (gcd y z) = gcd (lcm x y) (lcm x z)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a)) \<Longrightarrow> lcm x (gcd y z) = gcd (lcm x y) (lcm x z)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a))

goal (1 subgoal):
 1. \<not> (x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a)) \<Longrightarrow> lcm x (gcd y z) = gcd (lcm x y) (lcm x z)
[PROOF STEP]
hence "normalize (lcm x (gcd y z)) = normalize (gcd (lcm x y) (lcm x z))"
[PROOF STATE]
proof (prove)
using this:
\<not> (x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a))

goal (1 subgoal):
 1. normalize (lcm x (gcd y z)) = normalize (gcd (lcm x y) (lcm x z))
[PROOF STEP]
by (intro associatedI prime_factorization_subset_imp_dvd)
       (auto simp: lcm_eq_0_iff prime_factorization_gcd prime_factorization_lcm
          subset_mset.sup_inf_distrib1)
[PROOF STATE]
proof (state)
this:
normalize (lcm x (gcd y z)) = normalize (gcd (lcm x y) (lcm x z))

goal (1 subgoal):
 1. \<not> (x = (0::'a) \<or> y = (0::'a) \<or> z = (0::'a)) \<Longrightarrow> lcm x (gcd y z) = gcd (lcm x y) (lcm x z)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
normalize (lcm x (gcd y z)) = normalize (gcd (lcm x y) (lcm x z))

goal (1 subgoal):
 1. lcm x (gcd y z) = gcd (lcm x y) (lcm x z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lcm x (gcd y z) = gcd (lcm x y) (lcm x z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_impossible:
  "\<bar>y1\<bar> < x1 \<Longrightarrow> \<bar>y2\<bar> < x2 \<Longrightarrow> x1 * x2 + y1 * y2 \<noteq> 0" for x1 x2::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bar>y1\<bar> < x1; \<bar>y2\<bar> < x2\<rbrakk> \<Longrightarrow> x1 * x2 + y1 * y2 \<noteq> 0
[PROOF STEP]
proof goal_cases
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<bar>y1\<bar> < x1; \<bar>y2\<bar> < x2\<rbrakk> \<Longrightarrow> x1 * x2 + y1 * y2 \<noteq> 0
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
\<bar>y1\<bar> < x1
\<bar>y2\<bar> < x2

goal (1 subgoal):
 1. \<lbrakk>\<bar>y1\<bar> < x1; \<bar>y2\<bar> < x2\<rbrakk> \<Longrightarrow> x1 * x2 + y1 * y2 \<noteq> 0
[PROOF STEP]
have "- y1 * y2 \<le> abs y1 * abs y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - y1 * y2 \<le> \<bar>y1\<bar> * \<bar>y2\<bar>
[PROOF STEP]
by (metis abs_ge_minus_self abs_mult mult.commute mult_minus_right)
[PROOF STATE]
proof (state)
this:
- y1 * y2 \<le> \<bar>y1\<bar> * \<bar>y2\<bar>

goal (1 subgoal):
 1. \<lbrakk>\<bar>y1\<bar> < x1; \<bar>y2\<bar> < x2\<rbrakk> \<Longrightarrow> x1 * x2 + y1 * y2 \<noteq> 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- y1 * y2 \<le> \<bar>y1\<bar> * \<bar>y2\<bar>

goal (1 subgoal):
 1. \<lbrakk>\<bar>y1\<bar> < x1; \<bar>y2\<bar> < x2\<rbrakk> \<Longrightarrow> x1 * x2 + y1 * y2 \<noteq> 0
[PROOF STEP]
have "\<dots> < x1 * x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>y1\<bar> * \<bar>y2\<bar> < x1 * x2
[PROOF STEP]
apply (rule mult_strict_mono)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<bar>y1\<bar> < x1
 2. \<bar>y2\<bar> < x2
 3. 0 < x1
 4. 0 \<le> \<bar>y2\<bar>
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
\<bar>y1\<bar> < x1
\<bar>y2\<bar> < x2

goal (4 subgoals):
 1. \<bar>y1\<bar> < x1
 2. \<bar>y2\<bar> < x2
 3. 0 < x1
 4. 0 \<le> \<bar>y2\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>y1\<bar> * \<bar>y2\<bar> < x1 * x2

goal (1 subgoal):
 1. \<lbrakk>\<bar>y1\<bar> < x1; \<bar>y2\<bar> < x2\<rbrakk> \<Longrightarrow> x1 * x2 + y1 * y2 \<noteq> 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- y1 * y2 < x1 * x2
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
- y1 * y2 < x1 * x2

goal (1 subgoal):
 1. x1 * x2 + y1 * y2 \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 * x2 + y1 * y2 \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Log_divide:
  "\<lbrakk> 0 < a; a \<noteq> 1; 0 < x; 0 < y \<rbrakk>
   \<Longrightarrow> Log a (x/y) = Log a x - Log a y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; a \<noteq> 1; 0 < x; 0 < y\<rbrakk> \<Longrightarrow> Log a (x / y) = Log a x - Log a y
[PROOF STEP]
by (metis Log_inverse Log_mult divide_real_def
       inverse_positive_iff_positive minus_real_def)


[STATEMENT]
lemma power_diff_rev_if:
  assumes nz: "(a::'a::field) ~= 0"
  shows "(a^m) / (a^n) = (if n <= m then a ^ (m-n) else (1/a) ^ (n-m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))
[PROOF STEP]
proof (cases "n <= m")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n \<le> m \<Longrightarrow> a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))
 2. \<not> n \<le> m \<Longrightarrow> a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n \<le> m

goal (2 subgoals):
 1. n \<le> m \<Longrightarrow> a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))
 2. \<not> n \<le> m \<Longrightarrow> a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))
[PROOF STEP]
with nz
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
n \<le> m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)
n \<le> m

goal (1 subgoal):
 1. a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))
[PROOF STEP]
by (simp add: power_diff)
[PROOF STATE]
proof (state)
this:
a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))

goal (1 subgoal):
 1. \<not> n \<le> m \<Longrightarrow> a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> n \<le> m \<Longrightarrow> a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> n \<le> m

goal (1 subgoal):
 1. \<not> n \<le> m \<Longrightarrow> a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))
[PROOF STEP]
with nz
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
\<not> n \<le> m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)
\<not> n \<le> m

goal (1 subgoal):
 1. a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))
[PROOF STEP]
by (simp add: power_diff_inverse nonzero_inverse_eq_divide [THEN sym])
[PROOF STATE]
proof (state)
this:
a ^ m / a ^ n = (if n \<le> m then a ^ (m - n) else ((1::'a) / a) ^ (n - m))

goal:
No subgoals!
[PROOF STEP]
qed