src/HOL/Analysis/Gamma_Function.thy
changeset 65578 e4997c181cce
parent 64969 a6953714799d
child 65587 16a8991ab398
equal deleted inserted replaced
65577:32d4117ad6e8 65578:e4997c181cce
  1878   shows   "G x = Gamma x"
  1878   shows   "G x = Gamma x"
  1879 proof (rule antisym)
  1879 proof (rule antisym)
  1880   show "G x \<ge> Gamma x"
  1880   show "G x \<ge> Gamma x"
  1881   proof (rule tendsto_upperbound)
  1881   proof (rule tendsto_upperbound)
  1882     from G_lower[of x] show "eventually (\<lambda>n. Gamma_series x n \<le> G x) sequentially"
  1882     from G_lower[of x] show "eventually (\<lambda>n. Gamma_series x n \<le> G x) sequentially"
  1883       using eventually_ge_at_top[of "1::nat"] x by (auto elim!: eventually_mono)
  1883       using  x by (auto intro: eventually_mono[OF eventually_ge_at_top[of "1::nat"]])
  1884   qed (simp_all add: Gamma_series_LIMSEQ)
  1884   qed (simp_all add: Gamma_series_LIMSEQ)
  1885 next
  1885 next
  1886   show "G x \<le> Gamma x"
  1886   show "G x \<le> Gamma x"
  1887   proof (rule tendsto_lowerbound)
  1887   proof (rule tendsto_lowerbound)
  1888     have "(\<lambda>n. Gamma_series x n * (1 + x / real n)) \<longlonglongrightarrow> Gamma x * (1 + 0)"
  1888     have "(\<lambda>n. Gamma_series x n * (1 + x / real n)) \<longlonglongrightarrow> Gamma x * (1 + 0)"
  1889       by (rule tendsto_intros real_tendsto_divide_at_top 
  1889       by (rule tendsto_intros real_tendsto_divide_at_top 
  1890                Gamma_series_LIMSEQ filterlim_real_sequentially)+
  1890                Gamma_series_LIMSEQ filterlim_real_sequentially)+
  1891     thus "(\<lambda>n. Gamma_series x n * (1 + x / real n)) \<longlonglongrightarrow> Gamma x" by simp
  1891     thus "(\<lambda>n. Gamma_series x n * (1 + x / real n)) \<longlonglongrightarrow> Gamma x" by simp
  1892   next
  1892   next
  1893     from G_upper[of x] show "eventually (\<lambda>n. Gamma_series x n * (1 + x / real n) \<ge> G x) sequentially"
  1893     from G_upper[of x] show "eventually (\<lambda>n. Gamma_series x n * (1 + x / real n) \<ge> G x) sequentially"
  1894       using eventually_ge_at_top[of "2::nat"] x by (auto elim!: eventually_mono)
  1894       using x by (auto intro: eventually_mono[OF eventually_ge_at_top[of "2::nat"]])
  1895   qed simp_all
  1895   qed simp_all
  1896 qed
  1896 qed
  1897 
  1897 
  1898 theorem Gamma_pos_real_unique:
  1898 theorem Gamma_pos_real_unique:
  1899   assumes x: "x > 0"
  1899   assumes x: "x > 0"
  2470   let ?f = "\<lambda>n. fact n * exp (z * of_real (ln (of_nat n + 1))) / pochhammer z (n + 1)"
  2470   let ?f = "\<lambda>n. fact n * exp (z * of_real (ln (of_nat n + 1))) / pochhammer z (n + 1)"
  2471   let ?r = "\<lambda>n. ?f n / Gamma_series z n"
  2471   let ?r = "\<lambda>n. ?f n / Gamma_series z n"
  2472   let ?r' = "\<lambda>n. exp (z * of_real (ln (of_nat (Suc n) / of_nat n)))"
  2472   let ?r' = "\<lambda>n. exp (z * of_real (ln (of_nat (Suc n) / of_nat n)))"
  2473   from z have z': "z \<noteq> 0" by auto
  2473   from z have z': "z \<noteq> 0" by auto
  2474 
  2474 
  2475   have "eventually (\<lambda>n. ?r' n = ?r n) sequentially" using eventually_gt_at_top[of "0::nat"]
  2475   have "eventually (\<lambda>n. ?r' n = ?r n) sequentially" 
  2476     using z by (auto simp: divide_simps Gamma_series_def ring_distribs exp_diff ln_div add_ac
  2476     using z by (auto simp: divide_simps Gamma_series_def ring_distribs exp_diff ln_div add_ac
  2477                      elim!: eventually_mono dest: pochhammer_eq_0_imp_nonpos_Int)
  2477                      intro: eventually_mono eventually_gt_at_top[of "0::nat"] dest: pochhammer_eq_0_imp_nonpos_Int)
  2478   moreover have "?r' \<longlonglongrightarrow> exp (z * of_real (ln 1))"
  2478   moreover have "?r' \<longlonglongrightarrow> exp (z * of_real (ln 1))"
  2479     by (intro tendsto_intros LIMSEQ_Suc_n_over_n) simp_all
  2479     by (intro tendsto_intros LIMSEQ_Suc_n_over_n) simp_all
  2480   ultimately show "?r \<longlonglongrightarrow> 1" by (force dest!: Lim_transform_eventually)
  2480   ultimately show "?r \<longlonglongrightarrow> 1" by (force dest!: Lim_transform_eventually)
  2481 
  2481 
  2482   from eventually_gt_at_top[of "0::nat"]
  2482   from eventually_gt_at_top[of "0::nat"]