Development/AutomorphicArithmetic/PrimitiveCosets/CoreGm.lean
1import Development.AutomorphicArithmetic.PrimitiveCosets.CoreAtH2import Development.AutomorphicArithmetic.PrimitiveCosets.charsA3import Development.AutomorphicArithmetic.PrimitiveCosets.GmAEq4import Development.AutomorphicArithmetic.PrimitiveCosets.SigALe5import Development.AutomorphicArithmetic.PrimitiveCosets.hostFactsS6import Development.AutomorphicArithmetic.DedekindLFunctions.LandauTheorems.ChTop7import Development.AutomorphicArithmetic.DedekindLFunctions.LandauTheorems.ChCore89open UpperTheory.Comparison₂ Deduction.CH Formalism Formalism.HC Formalism.D5 Formalism.RankGapBounds.WeightedMeanData Formalism.LFunctionChainParameters.WeightedSlopeBounds Formalism.LFunctionChainParameters.characterSumData Formalism.LFunctionChainParameters.ThickSetMeanBounds Formalism.LFunctionChainParameters.LErr10Formalism.LFunctionChainParameters.LChain Formalism.LFunctionChainParameters.LHost1112theorem UpperTheory.Comparison₂.core_gm :13∀ (Λ : Level) (eD eL K cHH eK C eps : ℝ), 0 < eps → ∃ x1 : ℝ, ∀ x ≥ x1, ∀ (φ : Frame) (H : HostAx φ) (TT : Finset φ.A),14EAtH Λ H.toHostRaw TT x eps C → CoreAtH H.toHostRaw TT eD eL K cHH eK eps x →15Λ.Gm x ≤ x ^ ((1 : ℝ) / 2 + (eD + eL + 7) * eps) := by16intro Λ eD eL K cHH eK C eps heps17have ho : (0 : ℝ) ≤ Λ.o := Nat.cast_nonneg _18have hc : |(3 * (Λ.o : ℝ) + 1)⁻¹| ≤ 1 := by19rw [abs_of_nonneg (by positivity)]20exact inv_le_one_of_one_le₀ (by linarith)21obtain ⟨x₁, hx₁⟩ := Deduction.ch_core (max (eD + eL) 0 + 3) eps C (koOf Λ) (3 * (Λ.o : ℝ) + 1)⁻¹ (4 * (Λ.o : ℝ))22(by positivity) heps hc23obtain ⟨x₂, hx₂⟩ := large_x_eventually eps K cHH eK heps24obtain ⟨x₃, hx₃⟩ := Filter.eventually_atTop.125((tendsto_rpow_atTop heps).eventually_ge_atTop (1 + 4 * (Λ.o : ℝ)))26refine ⟨max x₁ (max x₂ x₃), fun x hx φ H TT hE hCore => ?_⟩27have g1 : x₁ ≤ x := le_trans (le_max_left _ _) hx28have g2 : x₂ ≤ x := le_trans (le_trans (le_max_left _ _) (le_max_right _ _)) hx29have g3 : x₃ ≤ x := le_trans (le_trans (le_max_right _ _) (le_max_right _ _)) hx30obtain ⟨U0, i0, tr, W, i4, i5, Top, i6, m, f, Dd, Cc, Xpp, ell, N, T2, a, w, eT, eP, η, X', θ,31hell, hxx, hε, heD, heL, hcHH, hcov, hId, hLed, hWin, hBN, hSz, hThin, hCost, hRest, hT2⟩ := hCore32subst hxx hε33have hLX := hx₂ _ g234have hWin' := hWin35obtain ⟨⟨w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15, w16, w17, w18, w19, w20, w21, w22,36w23, w24, w25, w26, w27, wC⟩, wEta⟩ := hWin'37obtain ⟨c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17⟩ := wC38have hLX' : LargeX Dd.x Dd.ε K Cc.cHH eK := by39refine ⟨hLX.1, le_trans ?_ hLX.2⟩40unfold KBig41exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (by linarith) (by positivity)) (by linarith)42have hb : 0 < Dd.b := by linarith43have hx0 : 0 < Dd.x := by linarith44have hk : 0 < Dd.k := by linarith45have ha : 0 ≤ Dd.a := le_trans (by positivity) w546have hE0 : 0 ≤ eD + eL := by linarith47rw [max_eq_left hE0] at hx₁48have hBr : 0 ≤ errorBracketSizeWindows Dd.x Dd.ε (Fintype.card φ.A) TT.card T2.card m Dd.b Dd.k Dd.a := by49unfold errorBracketSizeWindows50positivity