diff -r 5574d504cf36 -r 4ab9657b3257 src/HOL/Analysis/Gamma_Function.thy --- a/src/HOL/Analysis/Gamma_Function.thy Fri Dec 28 19:01:35 2018 +0100 +++ b/src/HOL/Analysis/Gamma_Function.thy Sat Dec 29 15:43:53 2018 +0100 @@ -552,7 +552,7 @@ shows "uniformly_convergent_on (ball z d) (\k z. \ik z. \i ball z d" have "norm z = norm (t + (z - t))" by simp @@ -665,7 +665,7 @@ fixes z :: "'a :: {real_normed_field,banach}" assumes z: "z \ 0" and n: "n \ 2" shows "uniformly_convergent_on (ball z d) (\k z. \inorm z * e\" { @@ -2528,29 +2528,29 @@ subsubsection \Weierstrass form\ -definition Gamma_series_weierstrass :: "'a :: {banach,real_normed_field} \ nat \ 'a" where - "Gamma_series_weierstrass z n = +definition Gamma_series_Weierstrass :: "'a :: {banach,real_normed_field} \ nat \ 'a" where + "Gamma_series_Weierstrass z n = exp (-euler_mascheroni * z) / z * (\k=1..n. exp (z / of_nat k) / (1 + z / of_nat k))" definition%unimportant - rGamma_series_weierstrass :: "'a :: {banach,real_normed_field} \ nat \ 'a" where - "rGamma_series_weierstrass z n = + rGamma_series_Weierstrass :: "'a :: {banach,real_normed_field} \ nat \ 'a" where + "rGamma_series_Weierstrass z n = exp (euler_mascheroni * z) * z * (\k=1..n. (1 + z / of_nat k) * exp (-z / of_nat k))" -lemma Gamma_series_weierstrass_nonpos_Ints: - "eventually (\k. Gamma_series_weierstrass (- of_nat n) k = 0) sequentially" - using eventually_ge_at_top[of n] by eventually_elim (auto simp: Gamma_series_weierstrass_def) - -lemma rGamma_series_weierstrass_nonpos_Ints: - "eventually (\k. rGamma_series_weierstrass (- of_nat n) k = 0) sequentially" - using eventually_ge_at_top[of n] by eventually_elim (auto simp: rGamma_series_weierstrass_def) - -theorem Gamma_weierstrass_complex: "Gamma_series_weierstrass z \ Gamma (z :: complex)" +lemma Gamma_series_Weierstrass_nonpos_Ints: + "eventually (\k. Gamma_series_Weierstrass (- of_nat n) k = 0) sequentially" + using eventually_ge_at_top[of n] by eventually_elim (auto simp: Gamma_series_Weierstrass_def) + +lemma rGamma_series_Weierstrass_nonpos_Ints: + "eventually (\k. rGamma_series_Weierstrass (- of_nat n) k = 0) sequentially" + using eventually_ge_at_top[of n] by eventually_elim (auto simp: rGamma_series_Weierstrass_def) + +theorem Gamma_Weierstrass_complex: "Gamma_series_Weierstrass z \ Gamma (z :: complex)" proof (cases "z \ \\<^sub>\\<^sub>0") case True then obtain n where "z = - of_nat n" by (elim nonpos_Ints_cases') - also from True have "Gamma_series_weierstrass \ \ Gamma z" - by (simp add: tendsto_cong[OF Gamma_series_weierstrass_nonpos_Ints] Gamma_nonpos_Int) + also from True have "Gamma_series_Weierstrass \ \ Gamma z" + by (simp add: tendsto_cong[OF Gamma_series_Weierstrass_nonpos_Ints] Gamma_nonpos_Int) finally show ?thesis . next case False @@ -2565,32 +2565,32 @@ from tendsto_exp[OF this] False z have "?f \ z * exp (euler_mascheroni * z) * Gamma z" by (simp add: exp_add exp_sum exp_diff mult_ac Gamma_complex_altdef A) from tendsto_mult[OF tendsto_const[of "exp (-euler_mascheroni * z) / z"] this] z - show "Gamma_series_weierstrass z \ Gamma z" - by (simp add: exp_minus divide_simps Gamma_series_weierstrass_def [abs_def]) + show "Gamma_series_Weierstrass z \ Gamma z" + by (simp add: exp_minus divide_simps Gamma_series_Weierstrass_def [abs_def]) qed lemma tendsto_complex_of_real_iff: "((\x. complex_of_real (f x)) \ of_real c) F = (f \ c) F" by (rule tendsto_of_real_iff) -lemma Gamma_weierstrass_real: "Gamma_series_weierstrass x \ Gamma (x :: real)" - using Gamma_weierstrass_complex[of "of_real x"] unfolding Gamma_series_weierstrass_def[abs_def] +lemma Gamma_Weierstrass_real: "Gamma_series_Weierstrass x \ Gamma (x :: real)" + using Gamma_Weierstrass_complex[of "of_real x"] unfolding Gamma_series_Weierstrass_def[abs_def] by (subst tendsto_complex_of_real_iff [symmetric]) (simp_all add: exp_of_real[symmetric] Gamma_complex_of_real) -lemma rGamma_weierstrass_complex: "rGamma_series_weierstrass z \ rGamma (z :: complex)" +lemma rGamma_Weierstrass_complex: "rGamma_series_Weierstrass z \ rGamma (z :: complex)" proof (cases "z \ \\<^sub>\\<^sub>0") case True then obtain n where "z = - of_nat n" by (elim nonpos_Ints_cases') - also from True have "rGamma_series_weierstrass \ \ rGamma z" - by (simp add: tendsto_cong[OF rGamma_series_weierstrass_nonpos_Ints] rGamma_nonpos_Int) + also from True have "rGamma_series_Weierstrass \ \ rGamma z" + by (simp add: tendsto_cong[OF rGamma_series_Weierstrass_nonpos_Ints] rGamma_nonpos_Int) finally show ?thesis . next case False - have "rGamma_series_weierstrass z = (\n. inverse (Gamma_series_weierstrass z n))" - by (simp add: rGamma_series_weierstrass_def[abs_def] Gamma_series_weierstrass_def + have "rGamma_series_Weierstrass z = (\n. inverse (Gamma_series_Weierstrass z n))" + by (simp add: rGamma_series_Weierstrass_def[abs_def] Gamma_series_Weierstrass_def exp_minus divide_inverse prod_inversef[symmetric] mult_ac) also from False have "\ \ inverse (Gamma z)" - by (intro tendsto_intros Gamma_weierstrass_complex) (simp add: Gamma_eq_zero_iff) + by (intro tendsto_intros Gamma_Weierstrass_complex) (simp add: Gamma_eq_zero_iff) finally show ?thesis by (simp add: Gamma_def) qed @@ -3175,17 +3175,17 @@ fixes z :: complex shows "(\n. of_real pi * z * (\k=1..n. 1 - z^2 / of_nat k^2)) \ sin (of_real pi * z)" proof - - let ?f = "rGamma_series_weierstrass" + let ?f = "rGamma_series_Weierstrass" have "(\n. (- of_real pi * inverse z) * (?f z n * ?f (- z) n)) \ (- of_real pi * inverse z) * (rGamma z * rGamma (- z))" - by (intro tendsto_intros rGamma_weierstrass_complex) + by (intro tendsto_intros rGamma_Weierstrass_complex) also have "(\n. (- of_real pi * inverse z) * (?f z n * ?f (-z) n)) = (\n. of_real pi * z * (\k=1..n. 1 - z^2 / of_nat k ^ 2))" proof fix n :: nat have "(- of_real pi * inverse z) * (?f z n * ?f (-z) n) = of_real pi * z * (\k=1..n. (of_nat k - z) * (of_nat k + z) / of_nat k ^ 2)" - by (simp add: rGamma_series_weierstrass_def mult_ac exp_minus + by (simp add: rGamma_series_Weierstrass_def mult_ac exp_minus divide_simps prod.distrib[symmetric] power2_eq_square) also have "(\k=1..n. (of_nat k - z) * (of_nat k + z) / of_nat k ^ 2) = (\k=1..n. 1 - z^2 / of_nat k ^ 2)" @@ -3257,7 +3257,7 @@ have "continuous_on (ball 0 1) f" proof (rule uniform_limit_theorem; (intro always_eventually allI)?) show "uniform_limit (ball 0 1) (\n x. \k ball 0 1" { fix k :: nat assume k: "k \ 1"