Development/AutomorphicArithmetic/DedekindLFunctions/LandauTheorems/ChCore.lean
101simp_rw [this]102rw [← Finset.sum_filter, Finset.filter_filter, thick_filter,103Finset.sum_image (fun s _ s' _ h => thick_inj u0 t (Set.mem_univ s) (Set.mem_univ s') h)]104rfl105have hn := CR.norm_avg_le (univ.filter (fun g : E0 × H => ¬ InPhi (g + topPl t))) (CR.card_S_le t _ (Finset.Subset.refl _))106(fun g ψ => ((w (cconj + g + topPl t) : ℝ) : ℂ) * GPsi D ell ψ (A / w (cconj + g + topPl t))107- (if IsThickAt T2 u0 (cconj + g + topPl t) then (b : ℂ) * GPsi D ell ψ (A / b) else 0))108(3 * (x + 1) * (η + 1) + (x + 1) * b * θ) (by positivity) (by109intro g hg ψ110have hρ := CR.partner_inPhi t (Finset.mem_filter.1 hg).2111have hw0 := hwpos _ hρ112have p1 : 0 ≤ 3 * (x + 1) * (η + 1) := by positivity113have p2 : 0 ≤ (x + 1) * b * θ := by positivity114by_cases hth : IsThickAt T2 u0 (cconj + g + topPl t)115· simp only [if_pos hth]116obtain ⟨k1, k2⟩ := hwthick _ hth117have hl := hLip ψ A (w (cconj + g + topPl t)) b hA0 hw0 hb118rw [min_eq_right k1, abs_of_nonneg (by linarith)] at hl119have e1 : 3 * A / b ≤ 3 * (x + 1) := by120rw [div_le_iff₀ hb]; nlinarith121have e2 : 3 * A / b * (w (cconj + g + topPl t) - b) ≤ 3 * (x + 1) * (η + 1) :=122mul_le_mul e1 (by linarith) (by linarith) (by positivity)123linarith124· simp only [if_neg hth, sub_zero]125have hw2 := hwthin _ hρ hth126have hy : X' / 3 ≤ A / w (cconj + g + topPl t) := by127rw [le_div_iff₀ hw0]128have k1 : X' / 3 * w (cconj + g + topPl t) ≤ X' / 3 * (2 * b') :=129mul_le_mul_of_nonneg_left hw2 (by positivity)130nlinarith131have ht' := hThin ψ _ hy132rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hw0]133have : w (cconj + g + topPl t) * ‖GPsi D ell ψ (A / w (cconj + g + topPl t))‖ ≤ (x + 1) * b * θ :=134calc w (cconj + g + topPl t) * ‖GPsi D ell ψ (A / w (cconj + g + topPl t))‖135≤ w (cconj + g + topPl t) * (A / w (cconj + g + topPl t) * θ) :=136mul_le_mul_of_nonneg_left ht' hw0.le137_ = A * θ := by field_simp138_ ≤ (x + 1) * b * θ := mul_le_mul_of_nonneg_right hA2 hθ139linarith)140have hre := (abs_le.1 (le_trans (Complex.abs_re_le_norm _) hn)).1141have e : (De D ell A t w).re - (Th D ell T2 b (A / b) u0 t).re = ((1 / ((PhiSet (H := H)).card : ℂ)) *142∑ g ∈ univ.filter (fun g : E0 × H => ¬ InPhi (g + topPl t)), ∑ ψ : AddChar (E0 × H) ℂ,143ψ (-g) * (((w (cconj + g + topPl t) : ℝ) : ℂ) * GPsi D ell ψ (A / w (cconj + g + topPl t))144- (if IsThickAt T2 u0 (cconj + g + topPl t) then (b : ℂ) * GPsi D ell ψ (A / b) else 0))).re := by145rw [CR.De_re, hTh]146unfold balTop147rw [← Complex.sub_re, ← mul_sub, ← Finset.sum_sub_distrib]148refine congrArg Complex.re (congrArg _ (Finset.sum_congr rfl fun g _ => ?_))149rw [← Finset.sum_sub_distrib]150exact Finset.sum_congr rfl fun ψ _ => by rw [CR.GC_host]; ring