import OAI.NumberTheory.TwoPoint.ShortIntervals.MRTCharacterEuler import OAI.NumberTheory.TwoPoint.Halasz.HalaszPrimeMass namespace OAI /-! Moving the finite character Euler product from Re(s)=1 to Re(s)=1+delta costs a bounded amount when delta=1/log X. All constants are independent of the character modulus and of the imaginary part. -/ namespace TwoPointCorrelations open Finset open scoped Classical ComplexConjugate lemma mrt_log_lipschitz_half {a b : ℝ} (ha : 1/2≤a) (hb : 1/2≤b) : |Real.log a-Real.log b|≤2*|a-b| := by have ha0 : 0 norm_ne_zero_iff.mpr (inv_ne_zero (hne (hz p hh)))) have hlog2 : Real.log ‖mrtCharacterShiftedEuler χ t δ S‖ = ∑ p ∈ S, Real.log ‖(1-(characterTwist χ t p/(p:ℂ))* (Real.exp (-δ*Real.log (p:ℝ)):ℂ))⁻¹‖ := by rw [mrtCharacterShiftedEuler,norm_prod] exact Real.log_prod (fun p hh => norm_ne_zero_iff.mpr (inv_ne_zero (hns p hh))) rw [hlog1,hlog2,← sum_sub_distrib,Finset.mul_sum] exact (abs_sum_le_sum_abs _ _).trans (sum_le_sum (fun p hh => mrt_character_euler_shift_local χ t hδ (hp p hh))) theorem mrt_character_euler_logarithmic_shift {q : ℕ} (χ : DirichletCharacter ℂ q) (t : ℝ) {X : ℕ} (hX : 1≤Real.log (X:ℝ)) (S : Finset ℕ) (hS : S⊆primesUpTo X) : |Real.log ‖mrtCharacterPrimeEuler χ t S‖- Real.log ‖mrtCharacterShiftedEuler χ t (1/Real.log (X:ℝ)) S‖| ≤ 2+2*halaszMertensConstant := by have hl0 : 0