Development/AutomorphicArithmetic/DedekindLFunctions/LandauTheorems/ChCore.lean
401rw [hA1]; ring402have hρ0 : 0 ≤ x ^ (-1 + ε) := Real.rpow_nonneg hx0.le _403have r1 : Cd ≤ A1 * (s * e) := by linarith [up Cd hCd]404have r2 : Real.log (x + 1) + Cd + |Ko| + |M| * x ^ (-1 + ε) * (x * (Real.log x + Cd + |Ko|)) ≤ A1 * (s * e) := by405have e1 : |M| * x ^ (-1 + ε) * (x * (Real.log x + Cd + |Ko|)) = |M| * ((Real.log x + Cd + |Ko|) * e) := by406rw [← hρ]; ring407have e2 : Real.log x + Cd + |Ko| ≤ (4 + Cd + |Ko|) * s := by408have := le_mul_of_one_le_right hCd hs1409have := le_mul_of_one_le_right (abs_nonneg Ko) hs1410linarith411have e3 : |M| * ((Real.log x + Cd + |Ko|) * e) ≤ |M| * ((4 + Cd + |Ko|) * s * e) :=412mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right e2 (by linarith)) (abs_nonneg M)413have e4 : |M| * ((4 + Cd + |Ko|) * s * e) = |M| * (4 + Cd + |Ko|) * (s * e) := by ring414rw [e1]415linarith [up Cd hCd, up _ (abs_nonneg Ko)]416have r3 : Real.log (x + 1) + Cd + |CE| * Real.log x ≤ A1 * (s * e) := by417have e1 : |CE| * Real.log x ≤ |CE| * (4 * (s * e)) := mul_le_mul_of_nonneg_left (by linarith) (abs_nonneg CE)418linarith [up Cd hCd]419have hone := CharacterBalanceMoves.one_char A0 Kp D ell TT (fun t => a t / b) (c := c) (ρ := |M| * x ^ (-1 + ε)) (Ko := |Ko|)420(L := |CE| * Real.log x) hx3 hCd hS.2.2.2.2.2.1 (hDer H D ell) (by positivity) (abs_nonneg _) h0K421(fun ψ h => (hKp ψ h).2)422(fun ψ h h' => (hE2 ψ h h').trans (by gcongr; exact le_abs_self M))423(fun ψ h h' => (hKo ψ h h').trans (le_abs_self Ko))424(fun ψ h h1 => (hE3 ψ h h1).trans (mul_le_mul_of_nonneg_right (le_abs_self CE) hl0))425r1 r2 r3426set G : ℝ := GmA D ell Kp c x - SigA D ell A0 Kp x with hG427have hY : (TT.card : ℝ) * (G - 4 * x ^ ((1 : ℝ) / 2 + ε)) ≤428∑ t ∈ TT, (∑ ψ ∈ PsiA A0, ψ (CharacterBalanceMoves.e1 t) * GPsi D ell ψ (a t / b)).re := by429simp_rw [Complex.re_sum]430rw [Finset.sum_comm]431refine le_trans ?_ (Finset.sum_le_sum hone)432rw [← Finset.mul_sum, Finset.sum_sub_distrib, CharacterBalanceMoves.sum_vv A0 Kp (fun ψ h => (hKp ψ h).1), Finset.sum_const,433nsmul_eq_mul, hX]434refine mul_le_mul_of_nonneg_left ?_ (Nat.cast_nonneg _)435have k1 := mul_le_mul_of_nonneg_right (hM.trans (le_abs_self M)) (show 0 ≤ A1 * (s * e) by positivity)436have k2 := mul_le_mul_of_nonneg_right hbig (show 0 ≤ s * e by positivity)437have k3 : 0 ≤ s * (s * e) := by positivity438have k4 : |M| * (A1 * (s * e)) = |M| * A1 * (s * e) := by ring439linarith440have hc' := CharacterBalanceMoves.core A0 D S hHost ell N TT T2 a w hx3 hb hS hThin hCost hT2 hTop hY441have hz := proposition_size_bound _ _ _ _ _ _ _ _ _ _ _ G hW hc'442linarith443444end Deduction445446end