module public import ConditionalGoldbach.Proofs.GammaSequenceBounds public import ConditionalGoldbach.Proofs.CauchyBoundedLimit /-! Euler's Gamma products converge also at the level of logarithmic derivatives. -/ public section set_option autoImplicit false noncomputable section open scoped BigOperators Topology open Set Complex Metric Filter namespace ConditionalGoldbach lemma GammaSeq_deriv_tendsto {s : โ„‚} (hs : 0 < s.re) : Tendsto (fun n => deriv (fun z => Complex.GammaSeq z n) s) atTop (๐“ (deriv Gamma s)) := by let r : โ„ := s.re/2 have hr : 0 < r := by dsimp [r]; positivity have hre : โˆ€z โˆˆ closedBall s r, z.re โˆˆ Icc r (3*s.re/2) := by intro z hz have hh := abs_re_le_norm (z-s) have hh' := Metric.mem_closedBall.mp hz rw [dist_eq_norm] at hh' simp only [sub_re,abs_le] at hh dsimp [r] at * constructor <;> linarith apply deriv_tendsto_of_bounded_circle (fun n z => Complex.GammaSeq z n) Gamma s r (max (Real.Gamma r) (Real.Gamma (3*s.re/2))) hr ยท filter_upwards [eventually_ne_atTop 0] with n hn intro z hz exact (GammaSeq_differentiableAt (lt_of_lt_of_le hr (hre z hz).1) hn).differentiableWithinAt ยท intro z hz exact (hasDerivAt_Gamma_of_re_pos (lt_of_lt_of_le hr (hre z hz).1)).differentiableAt.differentiableWithinAt ยท filter_upwards [eventually_ne_atTop 0] with n hn z hz have hz' := hre z (sphere_subset_closedBall hz) apply (GammaSeq_norm_le_Gamma_re (lt_of_lt_of_le hr hz'.1) hn).trans exact Real.convexOn_Gamma.le_max_of_mem_Icc hr (by change 0 < 3*s.re/2; positivity) hz' ยท intro z hz exact GammaSeq_tendsto_Gamma z lemma GammaSeq_logDeriv_tendsto {s : โ„‚} (hs : 0 < s.re) : Tendsto (fun n => logDeriv (fun z => Complex.GammaSeq z n) s) atTop (๐“ (logDeriv Gamma s)) := (GammaSeq_deriv_tendsto hs).div (GammaSeq_tendsto_Gamma s) (Gamma_ne_zero_of_re_pos hs) lemma GammaSeq_logDeriv {s : โ„‚} (hs : 0 < s.re) {n : โ„•} (hn : n โ‰  0) : logDeriv (fun z => Complex.GammaSeq z n) s = Complex.log (n:โ„‚) - โˆ‘ j โˆˆ Finset.range (n+1), 1/(s+(j:โ„‚)) := by have hnC : (n:โ„‚) โ‰  0 := by exact_mod_cast hn have hpn : โˆ€j : โ„•, s+(j:โ„‚) โ‰  0 := by intro j he have hh := congrArg Complex.re he simp only [add_re,natCast_re,zero_re] at hh have hj : (0:โ„) โ‰ค j := Nat.cast_nonneg j linarith let P : โ„‚ โ†’ โ„‚ := fun z => โˆ j โˆˆ Finset.range (n+1), (z+(j:โ„‚)) have hP : DifferentiableAt โ„‚ P s := DifferentiableAt.fun_finsetProd (fun j _ => differentiableAt_id.add_const _) have hPn : P s โ‰  0 := Finset.prod_ne_zero_iff.mpr (fun j _ => hpn j) have hQ := (differentiableAt_id.const_cpow (Or.inl hnC) : DifferentiableAt โ„‚ (fun z : โ„‚ => (n:โ„‚)^z) s) have hQn : (n:โ„‚)^s โ‰  0 := Complex.cpow_ne_zero_iff.mpr (Or.inl hnC) have hfact : (n.factorial:โ„‚) โ‰  0 := by exact_mod_cast Nat.factorial_ne_zero n change logDeriv (fun z => ((n:โ„‚)^z*(n.factorial:โ„‚))/P z) s = _ rw [logDeriv_fun_div (f := fun z : โ„‚ => (n:โ„‚)^z*(n.factorial:โ„‚)) (g := P) s (mul_ne_zero hQn hfact) hPn (hQ.mul_const _) hP, logDeriv_fun_mul (f := fun z : โ„‚ => (n:โ„‚)^z) (g := fun _ : โ„‚ => (n.factorial:โ„‚)) s hQn hfact hQ (differentiableAt_const _)] have hcp : logDeriv (fun z : โ„‚ => (n:โ„‚)^z) s = Complex.log (n:โ„‚) := by simpa using logDeriv_cpow_affine (n:โ„‚) 1 0 s hnC rw [hcp,logDeriv_const] simp only [Pi.zero_apply,add_zero] congr 1 have hPe : P = โˆ j โˆˆ Finset.range (n+1), fun z : โ„‚ => z+(j:โ„‚) := by funext z simp [P] rw [hPe] rw [logDeriv_prod (fun j _ => hpn j) (fun j _ => differentiableAt_id.add_const _)] apply Finset.sum_congr rfl intro j hj rw [logDeriv_apply,((hasDerivAt_id' s).add_const (j:โ„‚)).deriv] end ConditionalGoldbach